﻿using System;
using System.Data;
using System.Configuration;
using System.Data.SqlClient;

namespace Portal.Core.DAL
{
	public class StoredProcedures
	{
		private MainDB _db;

		public StoredProcedures(MainDB db)
		{
			_db = db;
		}

		public MainDB Database
		{
			get { return _db; }
		}

		public DataTable vc_SelectVoteByID(Int32 Vote_ID)
		{
			IDbCommand cmd = _db.CreateCommand("vc_SelectVoteByVoteID", true);
			_db.AddParameter(cmd, "iVote_ID", DbType.Int32, Vote_ID);
			DataTable table = _db.CreateDataTable(cmd);
			return table;
		}

		public DataTable vc_SelectNewsTitle_ThreadTitle(Int32 ThreadDetail_ID)
		{
			IDbCommand cmd = _db.CreateCommand("vc_SelectNewsTitle_ThreadTitle", true);
			_db.AddParameter(cmd, "iThreaddetails_ID", DbType.Int32, ThreadDetail_ID);
			DataTable table = _db.CreateDataTable(cmd);
			return table;
		}

		public String vc_SelectTitleNewsThread(Int32 Thread_ID)
		{
			IDbCommand cmd = _db.CreateCommand("vc_SelectTitleNewsThread", true);
			_db.AddParameter(cmd, "iThread_ID", DbType.Int32, Thread_ID);
			DataTable table = _db.CreateDataTable(cmd);
			if (table.Rows.Count == 0)
			{
				return String.Empty;
			}
			else
			{
				return table.Rows[0][0].ToString();
			}
		}

		public DataTable vc_SelectOneLogNews(Int64 Log_News_ID)
		{
			IDbCommand cmd = _db.CreateCommand("vc_SelectOneLogNews", true);
			_db.AddParameter(cmd, "iLog_News_ID", DbType.Int64, Log_News_ID);
			DataTable table = _db.CreateDataTable(cmd);
			return table;
		}

		public void vc_News_Update(Log_News logNews)
		{
			IDbCommand cmd = _db.CreateCommand("vc_News_Update", true);
			_db.AddParameter(cmd, "iCat_ID", DbType.Int32, logNews.Cat_ID);
			_db.AddParameter(cmd, "sNews_Title", DbType.String, logNews.News_Title);
			_db.AddParameter(cmd, "sNews_Subtitle", DbType.String, logNews.News_Subtitle);
			_db.AddParameter(cmd, "sNews_Image", DbType.String, logNews.News_Image);
			_db.AddParameter(cmd, "sNews_ImageNote", DbType.String, logNews.News_ImageNote);
			_db.AddParameter(cmd, "sNews_Content", DbType.String, logNews.News_Content);
			_db.AddParameter(cmd, "sNews_Author", DbType.String, logNews.News_Author);
			_db.AddParameter(cmd, "sNews_CurrEditor", DbType.String, logNews.News_CurrEditor);
			_db.AddParameter(cmd, "iNews_Status", DbType.Int32, logNews.News_Status);

			DateTime date = new DateTime();
			if (date == logNews.News_SwitchTime)
			{
				_db.AddParameter(cmd, "daNews_SwitchTime", DbType.DateTime, System.Data.SqlTypes.SqlDateTime.Null);
			}
			else
			{
				_db.AddParameter(cmd, "daNews_SwitchTime", DbType.DateTime, logNews.News_SwitchTime);
			}

			if (date == logNews.News_PublishDate)
			{
				_db.AddParameter(cmd, "daNews_PublishDate", DbType.DateTime, System.Data.SqlTypes.SqlDateTime.Null);
			}
			else
			{
				_db.AddParameter(cmd, "daNews_PublishDate", DbType.DateTime, logNews.News_PublishDate);
			}

			//_db.AddParameter(cmd, "daNews_PublishDate", DbType.DateTime, logNews.News_PublishDate);
			_db.AddParameter(cmd, "bNews_isFocus", DbType.Boolean, logNews.News_isFocus);
			_db.AddParameter(cmd, "iNews_Mode", DbType.Int32, logNews.News_Mode);

			_db.AddParameter(cmd, "iNews_ViewNum", DbType.Int32, logNews.News_ViewNum);


			if (date == logNews.News_CreateDate)
			{
				_db.AddParameter(cmd, "daNews_CreateDate", DbType.DateTime, System.Data.SqlTypes.SqlDateTime.Null);
			}
			else
			{
				_db.AddParameter(cmd, "daNews_CreateDate", DbType.DateTime, logNews.News_CreateDate);
			}

			//_db.AddParameter(cmd, "daNews_CreateDate", DbType.DateTime, logNews.News_CreateDate);

			if (date == logNews.News_ModifiedDate)
			{
				_db.AddParameter(cmd, "daNews_ModifiedDate", DbType.DateTime, System.Data.SqlTypes.SqlDateTime.Null);
			}
			else
			{
				_db.AddParameter(cmd, "daNews_ModifiedDate", DbType.DateTime, logNews.News_ModifiedDate);
			}

			//_db.AddParameter(cmd, "daNews_ModifiedDate", DbType.DateTime, logNews.News_ModifiedDate);
			_db.AddParameter(cmd, "sNews_Relation", DbType.String, logNews.News_Relation);
			_db.AddParameter(cmd, "dNews_Rate", DbType.Decimal, logNews.News_Rate);

			_db.AddParameter(cmd, "sNews_Other", DbType.String, logNews.News_Other);
			_db.AddParameter(cmd, "bIsComment", DbType.Boolean, logNews.IsComment);
			_db.AddParameter(cmd, "bIsUserRate", DbType.Boolean, logNews.IsUserRate);
			_db.AddParameter(cmd, "iTemplate", DbType.Int32, logNews.Template);
			_db.AddParameter(cmd, "iNews_ID", DbType.Int64, logNews.News_ID);
			_db.CreateDataTable(cmd);
		}

		public void vc_NewsPublished_Update(Log_News logNews)
		{
			IDbCommand cmd = _db.CreateCommand("vc_NewsPublished_Update", true);
			_db.AddParameter(cmd, "iCat_ID", DbType.Int32, logNews.Cat_ID);

			_db.AddParameter(cmd, "sNews_Title", DbType.String, logNews.News_Title);
			_db.AddParameter(cmd, "sNews_Subtitle", DbType.String, logNews.News_Subtitle);
			_db.AddParameter(cmd, "sNews_Image", DbType.String, logNews.News_Image);
			_db.AddParameter(cmd, "sNews_ImageNote", DbType.String, logNews.News_ImageNote);
			_db.AddParameter(cmd, "sNews_Content", DbType.String, logNews.News_Content);
			_db.AddParameter(cmd, "sNews_Author", DbType.String, logNews.News_Author);
			_db.AddParameter(cmd, "iNews_Status", DbType.Int32, logNews.News_Status);

			DateTime date = new DateTime();

			if (date == logNews.News_PublishDate)
			{
				_db.AddParameter(cmd, "daNews_PublishDate", DbType.DateTime, System.Data.SqlTypes.SqlDateTime.Null);
			}
			else
			{
				_db.AddParameter(cmd, "daNews_PublishDate", DbType.DateTime, logNews.News_PublishDate);
			}

			//_db.AddParameter(cmd, "daNews_PublishDate", DbType.DateTime, logNews.News_PublishDate);
			_db.AddParameter(cmd, "bNews_isFocus", DbType.Boolean, logNews.News_isFocus);
			_db.AddParameter(cmd, "iNews_Mode", DbType.Int32, logNews.News_Mode);


			if (date == logNews.News_ModifiedDate)
			{
				_db.AddParameter(cmd, "daNews_ModifiedDate", DbType.DateTime, System.Data.SqlTypes.SqlDateTime.Null);
			}
			else
			{
				_db.AddParameter(cmd, "daNews_ModifiedDate", DbType.DateTime, logNews.News_ModifiedDate);
			}

			//_db.AddParameter(cmd, "daNews_ModifiedDate", DbType.DateTime, logNews.News_ModifiedDate);
			_db.AddParameter(cmd, "sNews_Relation", DbType.String, logNews.News_Relation);
			_db.AddParameter(cmd, "dNews_Rate", DbType.Decimal, logNews.News_Rate);

			_db.AddParameter(cmd, "sNews_Other", DbType.String, logNews.News_Other);
			_db.AddParameter(cmd, "bIsComment", DbType.Boolean, logNews.IsComment);
			_db.AddParameter(cmd, "bIsUserRate", DbType.Boolean, logNews.IsUserRate);
			_db.AddParameter(cmd, "iTemplate", DbType.Int32, logNews.Template);
			_db.AddParameter(cmd, "iNews_ID", DbType.Int64, logNews.News_ID);
			_db.CreateDataTable(cmd);
		}

		public DataTable vc_LogNewsSelectAllByNewsID(Int64 News_ID)
		{
			IDbCommand cmd = _db.CreateCommand("vc_LogNewsSelectAllByNewsID", true);
			_db.AddParameter(cmd, "iNews_ID", DbType.Int64, News_ID);
			DataTable table = _db.CreateDataTable(cmd);
			return table;
		}

		public String vc_News_SelectNewsTitleByNewsID(Int64 News_ID)
		{
			IDbCommand cmd = _db.CreateCommand("vc_News_SelectNewsTitleByNewsID", true);
			_db.AddParameter(cmd, "iNews_ID", DbType.Int64, News_ID);
			DataTable table = _db.CreateDataTable(cmd);
			if (table.Rows.Count == 0)
			{
				return String.Empty;
			}
			else
			{
				return (String)table.Rows[0]["News_Title"];
			}
		}

		public Int64 vc_Log_News_SelectLogNewsID(Int64 News_ID)
		{
			IDbCommand cmd = _db.CreateCommand("LogNew_SelectLogNewsID", true);
			_db.AddParameter(cmd, "iNews_ID", DbType.Int64, News_ID);
			DataTable table = _db.CreateDataTable(cmd);
			if (table.Rows.Count == 0)
			{
				return 0;
			}
			else
			{
				return Convert.ToInt64(table.Rows[0]["Log_News_ID"]);
			}
		}

		public void vc_Log_Insert(String UserName, DateTime CreatedDate, String Action, Int32 Type, Int64 Object_ID)
		{
			IDbCommand cmd = _db.CreateCommand("Log_insert", true);
			_db.AddParameter(cmd, "sUserName", DbType.String, UserName);
			_db.AddParameter(cmd, "daCreatedDate", DbType.DateTime, CreatedDate);
			_db.AddParameter(cmd, "sAction", DbType.String, Action);
			_db.AddParameter(cmd, "iType", DbType.Int32, Type);
			_db.AddParameter(cmd, "iObject_ID", DbType.Int64, Object_ID);
			_db.CreateDataTable(cmd);
		}

		public void vc_Log_Update(String UserName, DateTime CreatedDate, String Action, Int32 Type, Int64 Object_ID, Int64 Log_ID)
		{
			IDbCommand cmd = _db.CreateCommand("Log_update", true);
			_db.AddParameter(cmd, "sUserName", DbType.String, UserName);
			_db.AddParameter(cmd, "daCreatedDate", DbType.DateTime, CreatedDate);
			_db.AddParameter(cmd, "sAction", DbType.String, Action);
			_db.AddParameter(cmd, "iType", DbType.Int32, Type);
			_db.AddParameter(cmd, "iObject_ID", DbType.Int64, Object_ID);
			_db.AddParameter(cmd, "iLog_ID", DbType.Int64, Log_ID);
			_db.CreateDataTable(cmd);
		}

		public void vc_Log_Delete(Int64 Log_ID)
		{
			IDbCommand cmd = _db.CreateCommand("Log_delete", true);
			_db.AddParameter(cmd, "iLog_ID", DbType.Int64, Log_ID);
			_db.CreateDataTable(cmd);
		}

		public DataTable vc_Log_SelectOne(Int64 Log_ID)
		{
			IDbCommand cmd = _db.CreateCommand("Log_select_one", true);
			_db.AddParameter(cmd, "iLog_ID", DbType.Int64, Log_ID);
			DataTable table = _db.CreateDataTable(cmd);
			return table;
		}
		public int vc_Log_SelectTotalRows()
		{
			IDbCommand cmd = _db.CreateCommand("Log_SelectTotalRows", true);
			DataTable table = _db.CreateDataTable(cmd);
			if (table.Rows.Count == 0)
			{
				return 0;
			}
			else
			{
				return Convert.ToInt32(table.Rows[0][0]);
			}
		}

		public int vc_Log_SelectTotalRows(string StrWhere)
		{
			IDbCommand cmd = _db.CreateCommand("Log_SelectTotalRowsNew", true);
			_db.AddParameter(cmd, "sStrWhere", DbType.String, StrWhere);
			DataTable table = _db.CreateDataTable(cmd);
			if (table.Rows.Count == 0)
			{
				return 0;
			}
			else
			{
				return Convert.ToInt32(table.Rows[0][0]);
			}
		}

		public DataTable vc_Log_SelectAll(Int32 StartIndex, Int32 Length)
		{
			IDbCommand cmd = _db.CreateCommand("Log_selectAll", true);
			_db.AddParameter(cmd, "iStartIndex", DbType.Int32, StartIndex);
			_db.AddParameter(cmd, "iLength", DbType.Int32, Length);
			DataTable table = _db.CreateDataTable(cmd);
			return table;
		}

		public DataTable vc_Log_SelectAll(String StrWhere, Int32 StartIndex, Int32 PageSize)
		{
			IDbCommand cmd = _db.CreateCommand("Log_selectAllWhere", true);
			_db.AddParameter(cmd, "iStartIndex", DbType.Int32, StartIndex);
			_db.AddParameter(cmd, "iPageSize", DbType.Int32, PageSize);
			_db.AddParameter(cmd, "sStrWhere", DbType.String, StrWhere);
			DataTable table = _db.CreateDataTable(cmd);
			return table;
		}

		public DataView vc_SelectAllCategory(String sort, Int32 startIndex, Int32 pageSize, ref Int32 totalRows)
		{
			IDbCommand cmd = _db.CreateCommand("vc_SelectCategoryAll", true);
			_db.AddParameter(cmd, "iStartIndex", DbType.Int32, startIndex);
			_db.AddParameter(cmd, "iPageSize", DbType.Int32, pageSize);

			DataTable table = _db.CreateDataTable(cmd);
			DataView dv = table.DefaultView;

			dv.Sort = sort;

			cmd = _db.CreateCommand("vc_SelectCountCategory", true);
			table = _db.CreateDataTable(cmd);
			totalRows = Convert.ToInt32(table.Rows[0][0]);
			return dv;
		}

		/// <summary>
		/// 
		/// </summary>
		/// <returns></returns>
		/// 
		public DataTable vc_KQBinhChonFC()
		{
			IDbCommand cmd = _db.CreateCommand("vc_KQBinhChonFC", true);
			DataTable dataTable = CreateDataTable(cmd);
			return dataTable;
		}
		/// <summary>
		/// ThienTD
		/// </summary>
		/// <param name="Add"></param>
		/// <param name="Birth"></param>
		/// <param name="Email"></param>
		/// <param name="Name"></param>
		/// <param name="SBD"></param>
		/// <returns></returns>
		public DataTable vc_insertBinhChonFC(String Add, DateTime Birth, String Email, String Name, Int32 SBD)
		{
			IDbCommand cmd = _db.CreateCommand("vc_insertBinhChonFC", true);
			_db.AddParameter(cmd, "Add", DbType.String, Add);
			_db.AddParameter(cmd, "Birth", DbType.DateTime, Birth);
			_db.AddParameter(cmd, "Email", DbType.String, Email);
			_db.AddParameter(cmd, "Name", DbType.String, Name);
			_db.AddParameter(cmd, "SBD", DbType.Int32, SBD);
			DataTable dataTable = CreateDataTable(cmd);
			return dataTable;
		}
		/// <summary>
		/// TrungNT-Created 3/12/2007
		/// 
		/// </summary>
		/// <param name="Music_ID"></param>
		/// <returns></returns>
		public DataTable GetMusicByMusicID(int Music_ID)
		{
			IDbCommand cmd = _db.CreateCommand("GetMusicByMusicID", true);
			_db.AddParameter(cmd, "Music_ID", DbType.Int32, Music_ID);
			DataTable dataTable = CreateDataTable(cmd);
			return dataTable;
		}
		public DataTable GetRankTableMusic()
		{
			IDbCommand cmd = _db.CreateCommand("GetRankTableMusic", true);
			DataTable dataTable = CreateDataTable(cmd);
			return dataTable;
		}
		/// <summary>
		/// TrungNT-Created 3/12/2007
		/// </summary>
		/// <returns></returns>
		public DataTable SelectTop1RandomFilm()
		{
			IDbCommand cmd = _db.CreateCommand("SelectTop1RandomFilm", true);
			DataTable dataTable = CreateDataTable(cmd);
			return dataTable;
		}
		/// <summary>
		/// TrungNT-Created 3/12/2007
		/// </summary>
		/// <param name="City_ID"></param>
		/// <returns></returns>
		public DataTable GetCinemaByCityID(int City_ID)
		{
			IDbCommand cmd = _db.CreateCommand("GetCinemaByCityID", true);
			_db.AddParameter(cmd, "City_ID", DbType.Int32, City_ID);
			DataTable dataTable = CreateDataTable(cmd);
			return dataTable;
		}
		/// <summary>
		/// TrungNT-Created 3/12/2007
		/// </summary>
		/// <returns></returns>
		public DataTable GetAllCity()
		{
			IDbCommand cmd = _db.CreateCommand("GetAllCity", true);
			DataTable dataTable = CreateDataTable(cmd);
			return dataTable;
		}
		/// <summary>
		/// TrungNT-Created 3/12/2007
		/// </summary>
		/// <returns></returns>
		public DataTable GetImageSlideShowCine()
		{
			IDbCommand cmd = _db.CreateCommand("GetImageSlideShowCine", true);
			DataTable dataTable = CreateDataTable(cmd);
			return dataTable;
		}

		/// <summary>
		/// TrungNT-Created 3/12/2007
		/// </summary>
		/// <returns></returns>
		public DataTable GetFilmScheduleInHome()
		{
			IDbCommand cmd = _db.CreateCommand("GetFilmScheduleInHome", true);
			DataTable dataTable = CreateDataTable(cmd);
			return dataTable;
		}

		/// <summary>
		/// TrungNT-Created 3/12/2007
		/// Lấy ra số lượng trailer có trong cơ sở dữ liệu
		/// </summary>
		/// <returns></returns>
		public DataTable GetTrailerCount()
		{
			IDbCommand cmd = _db.CreateCommand("GetTrailerCount", true);
			DataTable dataTable = CreateDataTable(cmd);
			return dataTable;
		}

		/// <summary>
		/// DuongNA
		/// lấy ra ngẫu nhiên 1 film từ 10 film mới nhất trong bảng film
		/// </summary>
		/// <returns></returns>
		public DataTable GetRandomTop10Film()
		{
			IDbCommand cmd = _db.CreateCommand("GetRandomTop10Film", true);
			DataTable dataTable = CreateDataTable(cmd);
			return dataTable;
		}
		#region Trung-Thêm 30/11/2007

		public DataTable vc_GetListImageBackNumber()
		{
			IDbCommand cmd = _db.CreateCommand("vc_GetListImageBackNumber", true);
			DataTable dataTable = CreateDataTable(cmd);
			return dataTable;
		}
		public DataTable GetFocusNewsInFashion(Int32 Cat_ID, Int32 News_Mode)
		{
			IDbCommand cmd = _db.CreateCommand("GetFocusNewsInFashion", true);
			_db.AddParameter(cmd, "Cat_ID", DbType.Int32, Cat_ID);
			_db.AddParameter(cmd, "News_Mode", DbType.Int32, News_Mode);
			DataTable dataTable = CreateDataTable(cmd);
			return dataTable;
		}
		public DataTable GetOtherProFilm(Int32 FilmID, Int32 numberOfOtherFilm)
		{
			IDbCommand cmd = _db.CreateCommand("GetOtherProFilm", true);
			_db.AddParameter(cmd, "FilmID", DbType.Int32, FilmID);
			_db.AddParameter(cmd, "numberOfOtherFilm", DbType.Int32, numberOfOtherFilm);
			DataTable dataTable = CreateDataTable(cmd);
			return dataTable;
		}
		public DataTable GetCountNewsPublishedRecord_Query(int Cat_ParentID, int Cat_ID, int News_Status)
		{
			IDbCommand cmd = _db.CreateCommand("GetCountNewsPublishedRecord_Query", true);
			_db.AddParameter(cmd, "Cat_ParentID", DbType.Int32, Cat_ParentID);
			_db.AddParameter(cmd, "Cat_ID", DbType.Int32, Cat_ID);
			_db.AddParameter(cmd, "News_Status", DbType.Int32, News_Status);
			DataTable dataTable = CreateDataTable(cmd);
			return dataTable;
		}

		public DataTable GetVoteRateNumber(int VoteIt_ID)
		{
			IDbCommand cmd = _db.CreateCommand("GetVoteRateNumber", true);
			_db.AddParameter(cmd, "VoteIt_ID", DbType.Int32, VoteIt_ID);

			DataTable dataTable = CreateDataTable(cmd);
			return dataTable;
		}

		public DataTable UpdateVoteRate(int VoteIt_ID, int NewRate)
		{
			IDbCommand cmd = _db.CreateCommand("UpdateVoteRate", true);
			_db.AddParameter(cmd, "VoteIt_ID", DbType.Int32, VoteIt_ID);
			_db.AddParameter(cmd, "NewRate", DbType.Int32, NewRate);
			DataTable dataTable = CreateDataTable(cmd);
			return dataTable;
		}
		public DataTable GetAllSurveyBySurveyParentID(int ParentID)
		{
			IDbCommand cmd = _db.CreateCommand("GetAllSurveyBySurveyParentID", true);
			_db.AddParameter(cmd, "ParentID", DbType.Int32, ParentID);
			DataTable dataTable = CreateDataTable(cmd);
			return dataTable;
		}
		public DataTable GetSurveyItemByVoteID(int id)
		{
			IDbCommand cmd = _db.CreateCommand("GetSurveyItemByVoteID", true);
			_db.AddParameter(cmd, "id", DbType.Int32, id);
			DataTable dataTable = CreateDataTable(cmd);
			return dataTable;
		}
		public DataTable GetListTrailer(Int32 PageIndex, Int32 PageNums)
		{
			IDbCommand cmd = _db.CreateCommand("GetListTrailer", true);
			_db.AddParameter(cmd, "PageIndex", DbType.Int32, PageIndex);
			_db.AddParameter(cmd, "PageNums", DbType.Int32, PageNums);
			DataTable dataTable = CreateDataTable(cmd);
			return dataTable;
		}
		public DataTable GetFilmProfileByFilmID(int FilmID)
		{
			IDbCommand cmd = _db.CreateCommand("GetFilmProfileByFilmID", true);
			_db.AddParameter(cmd, "FilmID", DbType.Int32, FilmID);
			DataTable dataTable = CreateDataTable(cmd);
			return dataTable;
		}
		public DataTable GetCategoryIcon(int CatParentID)
		{
			IDbCommand cmd = _db.CreateCommand("GetCategoryIcon", true);
			_db.AddParameter(cmd, "CatParentID", DbType.Int32, CatParentID);
			DataTable dataTable = CreateDataTable(cmd);
			return dataTable;
		}

		public DataTable GetBirthDayInMonth(int Month)
		{
			IDbCommand cmd = _db.CreateCommand("GetBirthDayInMonth", true);
			_db.AddParameter(cmd, "Month", DbType.Int32, Month);
			DataTable dataTable = CreateDataTable(cmd);
			return dataTable;
		}

		#endregion

		/// <summary>
		/// 
		/// </summary>
		/// <returns></returns>
		public DataTable vc_selectTopFocusPoster()
		{
			IDbCommand cmd = _db.CreateCommand("vc_selectTopFocusPoster", true);
			DataTable dataTable = CreateDataTable(cmd);
			return dataTable;
		}
		/// <summary>
		/// 
		/// </summary>
		/// <param name="PageIndex"></param>
		/// <param name="PageNums"></param>
		/// <returns></returns>
		public DataTable vc_SelectListProfileFilms(Int32 PageIndex, Int32 PageNums)
		{
			IDbCommand cmd = _db.CreateCommand("vc_SelectListProfileFilms", true);
			_db.AddParameter(cmd, "PageIndex", DbType.Int32, PageIndex);
			_db.AddParameter(cmd, "PageNums", DbType.Int32, PageNums);
			DataTable dataTable = CreateDataTable(cmd);
			return dataTable;
		}
		public DataTable SelectListFocusedProfileFilm(Int32 PageIndex, Int32 PageNums)
		{
			IDbCommand cmd = _db.CreateCommand("vc_SelectListFocusedProfileFilms", true);
			_db.AddParameter(cmd, "PageIndex", DbType.Int32, PageIndex);
			_db.AddParameter(cmd, "PageNums", DbType.Int32, PageNums);
			DataTable dataTable = CreateDataTable(cmd);
			return dataTable;
		}
		/// <summary>
		/// 
		/// </summary>
		/// <param name="TopRow"></param>
		/// <param name="TopLink"></param>
		/// <param name="Cat_ID"></param>
		/// <returns></returns>
		public DataTable vc_selectTinChuyenMucTrangChu(Int32 TopRow, Int32 TopLink, Int32 Cat_ID)
		{
			IDbCommand cmd = _db.CreateCommand("vc_selectTinChuyenMucTrangChu", true);
			_db.AddParameter(cmd, "TopRow", DbType.Int32, TopRow);
			_db.AddParameter(cmd, "TopLink", DbType.Int32, TopLink);
			_db.AddParameter(cmd, "Cat_ID", DbType.Int32, Cat_ID);
			DataTable dataTable = CreateDataTable(cmd);
			return dataTable;
		}
		/// <summary>
		/// 
		/// </summary>
		/// <param name="Row"></param>
		/// <param name="Cat_ID"></param>
		/// <returns></returns>
		public DataTable vc_selectTinNoiBatTrangChu(Int32 Row, Int32 Cat_ID)
		{
			IDbCommand cmd = _db.CreateCommand("vc_selectTinNoiBatTrangChu", true);
			_db.AddParameter(cmd, "Row", DbType.Int32, Row);
			_db.AddParameter(cmd, "Cat_ID", DbType.Int32, Cat_ID);
			DataTable dataTable = CreateDataTable(cmd);
			return dataTable;
		}
		/// <summary>
		/// 
		/// </summary>
		/// <param name="Condition"></param>
		/// <param name="OrderBy"></param>
		/// <returns></returns>
		public DataTable vc_GetRowCountSearchResult(String Condition, String OrderBy)
		{
			IDbCommand cmd = _db.CreateCommand("vc_GetRowCountSearchResult", true);
			_db.AddParameter(cmd, "Condition", DbType.String, Condition);
			_db.AddParameter(cmd, "OrderBy", DbType.String, OrderBy);
			DataTable dataTable = CreateDataTable(cmd);
			return dataTable;
		}
		public DataTable vc_SelectTinMoiCapNhat(DateTime NewsDate, Int64 NewsID, Int32 Cat_ID)
		{
			IDbCommand cmd = _db.CreateCommand("vc_SelectTinMoiCapNhat", true);
			_db.AddParameter(cmd, "NewsDate", DbType.DateTime, NewsDate);
			_db.AddParameter(cmd, "NewsID", DbType.Int64, NewsID);
			_db.AddParameter(cmd, "Cat_ID", DbType.Int32, Cat_ID);
			DataTable dataTable = CreateDataTable(cmd);
			return dataTable;
		}
		/// <summary>
		/// 
		/// </summary>
		/// <param name="PageIndex"></param>
		/// <param name="Condition"></param>
		/// <param name="PageNums"></param>
		/// <param name="OrderBy"></param>
		/// <returns></returns>
		public DataTable vc_SearchResult(Int32 PageIndex, String Condition, Int32 PageNums, String OrderBy)
		{
			IDbCommand cmd = _db.CreateCommand("vc_SearchResult", true);
			_db.AddParameter(cmd, "PageIndex", DbType.Int32, PageIndex);
			_db.AddParameter(cmd, "Condition", DbType.String, Condition);
			_db.AddParameter(cmd, "PageNums", DbType.Int32, PageNums);
			_db.AddParameter(cmd, "OrderBy", DbType.String, OrderBy);
			DataTable dataTable = CreateDataTable(cmd);
			return dataTable;
		}

		/// <summary>
		/// 
		/// </summary>
		/// <param name="SP_ID"></param>
		/// <returns></returns>
		public DataTable vc_SelectInMonthOfSP_ID(Int32 SP_ID)
		{
			IDbCommand cmd = _db.CreateCommand("vc_SelectInMonthOfSP_ID", true);
			_db.AddParameter(cmd, "SP_ID", DbType.Int32, SP_ID);
			DataTable dataTable = CreateDataTable(cmd);
			return dataTable;
		}
		/// <summary>
		/// 
		/// </summary>
		/// <param name="newsID"></param>
		/// <returns></returns>
		public DataTable vc_GetNewsPath(Int64 newsID)
		{
			IDbCommand cmd = _db.CreateCommand("GetNewsPath", true);
			_db.AddParameter(cmd, "new_id", DbType.Int64, newsID);
			DataTable dataTable = CreateDataTable(cmd);
			return dataTable;
		}
		/// <summary>
		/// 
		/// </summary>
		/// <param name="CatID"></param>
		/// <returns></returns>
		public DataTable vc_GetCatPath(Int32 CatID)
		{
			IDbCommand cmd = _db.CreateCommand("GetCatPath", true);
			_db.AddParameter(cmd, "cat_id", DbType.Int32, CatID);
			DataTable dataTable = CreateDataTable(cmd);
			return dataTable;
		}
		/// <summary>
		/// 
		/// </summary>
		/// <returns></returns>
		/// 
		public DataTable vc_SelectStyleupMaxMark()
		{
			IDbCommand cmd = _db.CreateCommand("vc_SelectStyleupMaxMark", true);
			DataTable dataTable = CreateDataTable(cmd);
			return dataTable;
		}
		public DataTable vc_SelectListShowedCategory(Int32 CatParentID, Int32 No)
		{
			IDbCommand cmd = _db.CreateCommand("vc_SelectListShowedCategory", true);
			_db.AddParameter(cmd, "CatParentID", DbType.Int32, CatParentID);
			_db.AddParameter(cmd, "No", DbType.Int32, No);
			DataTable dataTable = CreateDataTable(cmd);
			return dataTable;
		}
		/// <summary>
		/// 
		/// </summary>
		/// <param name="RowCount"></param>
		/// <param name="Month"></param>
		/// <param name="Year"></param>
		/// <returns></returns>
		public DataTable vc_GetTopStyleUpInMonth(Int32 RowCount, Int32 Month, Int32 Year)
		{
			IDbCommand cmd = _db.CreateCommand("vc_GetTopStyleUpInMonth", true);
			_db.AddParameter(cmd, "RowCount", DbType.Int32, RowCount);
			_db.AddParameter(cmd, "Month", DbType.Int32, Month);
			_db.AddParameter(cmd, "Year", DbType.Int32, Year);
			DataTable dataTable = CreateDataTable(cmd);
			return dataTable;
		}
		/// <summary>
		/// 
		/// </summary>
		/// <param name="Month"></param>
		/// <param name="Year"></param>
		/// <returns></returns>
		public DataTable vc_GetListImgBackNumberInMonth(Int32 Month, Int32 Year)
		{
			IDbCommand cmd = _db.CreateCommand("vc_GetListImgBackNumberInMonth", true);
			_db.AddParameter(cmd, "Month", DbType.Int32, Month);
			_db.AddParameter(cmd, "Year", DbType.Int32, Year);
			DataTable dataTable = CreateDataTable(cmd);
			return dataTable;
		}
		/// <summary>
		/// 
		/// </summary>
		/// <param name="Cat_ID"></param>
		/// <returns></returns>
		public DataTable vc_SelectNewsFocusInModule(Int32 Cat_ID)
		{
			IDbCommand cmd = _db.CreateCommand("vc_SelectNewsFocusInModule", true);
			_db.AddParameter(cmd, "Cat_ID", DbType.Int32, Cat_ID);
			DataTable dataTable = CreateDataTable(cmd);
			return dataTable;
		}
		/// <summary>
		/// Lấy ra thí sinh có điểm bầu chọn cao nhất trong tháng
		/// </summary>
		/// <param name="Month"></param>
		/// <returns></returns>
		public DataTable vc_SelectPersonOfMonth(Int32 Month)
		{
			IDbCommand cmd = _db.CreateCommand("vc_SelectPersonOfMonth", true);
			_db.AddParameter(cmd, "Month", DbType.Int32, Month);
			DataTable dataTable = CreateDataTable(cmd);
			return dataTable;
		}
		/// <summary>
		/// 
		/// </summary>
		/// <param name="News_Mod"></param>
		/// <param name="rowCount"></param>
		/// <param name="Cat_ID"></param>
		/// <returns></returns>
		public DataTable vc_getNewsPulishedModuleFocus(Int32 News_Mod, Int32 rowCount, Int32 Cat_ID)
		{
			IDbCommand cmd = _db.CreateCommand("vc_getNewsPulishedModuleFocus", true);
			_db.AddParameter(cmd, "News_Mod", DbType.Int32, News_Mod);
			_db.AddParameter(cmd, "rowCount", DbType.Int32, rowCount);
			_db.AddParameter(cmd, "Cat_ID", DbType.Int32, Cat_ID);
			DataTable dataTable = CreateDataTable(cmd);
			return dataTable;
		}
		/// <summary>
		/// Tăng điểm bình chọn
		/// </summary>
		/// <param name="voteStep"></param>
		/// <param name="SP_ID"></param>
		/// <returns></returns>
		public DataTable vc_UpdateStyless_PersioonMark(Int32 voteStep, Int32 SP_ID)
		{
			IDbCommand cmd = _db.CreateCommand("vc_UpdateStyless_PersioonMark", true);
			_db.AddParameter(cmd, "voteStep", DbType.Int32, voteStep);
			_db.AddParameter(cmd, "SP_ID", DbType.Int32, SP_ID);
			DataTable dataTable = CreateDataTable(cmd);
			return dataTable;
		}
		/// <summary>
		/// Lấy ra các comment cho từng SP_ID
		/// </summary>
		/// <param name="SP_ID"></param>
		/// <returns></returns>
		public DataTable vc_SelectCommentsBySPID(Int32 SP_ID)
		{
			IDbCommand cmd = _db.CreateCommand("vc_SelectCommentsBySPID", true);
			_db.AddParameter(cmd, "SP_ID", DbType.Int32, SP_ID);
			DataTable dataTable = CreateDataTable(cmd);
			return dataTable;
		}
		/// <summary>
		/// 
		/// </summary>
		/// <param name="SP_ID"></param>
		/// <returns></returns>
		public DataTable vc_SelectStyleupNewsBySP_ID(Int32 SP_ID)
		{
			IDbCommand cmd = _db.CreateCommand("vc_SelectStyleupNewsBySP_ID", true);
			_db.AddParameter(cmd, "SP_ID", DbType.Int32, SP_ID);
			DataTable dataTable = CreateDataTable(cmd);
			return dataTable;
		}


		protected DataTable CreateDataTable(IDbCommand command)
		{
			return _db.CreateDataTable(command);
		}
		/// <summary>
		/// 
		/// </summary>
		/// <param name="Date"></param>
		/// <param name="ThreadID"></param>
		/// <returns></returns>
		public DataTable vc_SelectCountNewsPublishedInThreadByThreadIDInDate(DateTime Date, Int32 ThreadID)
		{
			IDbCommand cmd = _db.CreateCommand("vc_SelectCountNewsPublishedInThreadByThreadIDInDate", true);
			_db.AddParameter(cmd, "Date", DbType.DateTime, Date);
			_db.AddParameter(cmd, "ThreadID", DbType.Int32, ThreadID);
			DataTable dataTable = CreateDataTable(cmd);
			return dataTable;
		}
		/// <summary>
		/// 
		/// </summary>
		/// <param name="PageIndex"></param>
		/// <param name="PageNums"></param>
		/// <param name="Date"></param>
		/// <param name="ThreadID"></param>
		/// <returns></returns>
		public DataTable vc_SelectNewsPublishedInThreadByThreadIDInDate(Int32 PageIndex, Int32 PageNums, DateTime Date, Int32 ThreadID)
		{
			IDbCommand cmd = _db.CreateCommand("vc_SelectNewsPublishedInThreadByThreadIDInDate", true);
			_db.AddParameter(cmd, "PageIndex", DbType.Int32, PageIndex);
			_db.AddParameter(cmd, "PageNums", DbType.Int32, PageNums);
			_db.AddParameter(cmd, "Date", DbType.DateTime, Date);
			_db.AddParameter(cmd, "ThreadID", DbType.Int32, ThreadID);
			DataTable dataTable = CreateDataTable(cmd);
			return dataTable;
		}
		/// <summary>
		/// 
		/// </summary>
		/// <param name="TopSelect"></param>
		/// <param name="ThreadID"></param>
		/// <param name="News_PublishDate"></param>
		/// <returns></returns>
		public DataTable vc_SelectNewsPublishedOtherInThread(Int32 TopSelect, Int32 ThreadID, DateTime News_PublishDate)
		{
			IDbCommand cmd = _db.CreateCommand("vc_SelectNewsPublishedOtherInThread", true);
			_db.AddParameter(cmd, "TopSelect", DbType.Int32, TopSelect);
			_db.AddParameter(cmd, "ThreadID", DbType.Int32, ThreadID);
			_db.AddParameter(cmd, "News_PublishDate", DbType.DateTime, News_PublishDate);
			DataTable dataTable = CreateDataTable(cmd);
			return dataTable;
		}
		/// <summary>
		/// 
		/// </summary>
		/// <param name="ThreadID"></param>
		/// <returns></returns>
		public DataTable vc_SelectCountNewsPublishedInThreadByThreadID(Int32 ThreadID)
		{
			IDbCommand cmd = _db.CreateCommand("vc_SelectCountNewsPublishedInThreadByThreadID", true);
			_db.AddParameter(cmd, "ThreadID", DbType.Int32, ThreadID);
			DataTable dataTable = CreateDataTable(cmd);
			return dataTable;
		}
		/// <summary>
		/// 
		/// </summary>
		/// <param name="PageIndex"></param>
		/// <param name="PageNums"></param>
		/// <param name="ThreadID"></param>
		/// <returns></returns>
		public DataTable vc_SelectNewsPublishedInThreadByThreadID(Int32 PageIndex, Int32 PageNums, Int64 ThreadID)
		{
			IDbCommand cmd = _db.CreateCommand("vc_SelectNewsPublishedInThreadByThreadID", true);
			_db.AddParameter(cmd, "PageIndex", DbType.Int32, PageIndex);
			_db.AddParameter(cmd, "PageNums", DbType.Int32, PageNums);
			_db.AddParameter(cmd, "ThreadID", DbType.Int64, ThreadID);
			DataTable dataTable = CreateDataTable(cmd);
			return dataTable;
		}
		/// <summary>
		/// 
		/// </summary>
		/// <param name="NewsID"></param>
		/// <returns></returns>
		public DataTable vc_SelectCountNewsPublishedInThreadByNewsID(Int64 NewsID)
		{
			IDbCommand cmd = _db.CreateCommand("vc_SelectCountNewsPublishedInThreadByNewsID", true);
			_db.AddParameter(cmd, "NewsID", DbType.Int64, NewsID);
			DataTable dataTable = CreateDataTable(cmd);
			return dataTable;
		}
		/// <summary>
		/// 
		/// 
		/// </summary>
		/// <param name="PageIndex"></param>
		/// <param name="PageNums"></param>
		/// <param name="NewsID"></param>
		/// <returns></returns>
		public DataTable vc_SelectNewsPublishedInThreadByNewsID(Int32 PageIndex, Int32 PageNums, Int64 NewsID)
		{
			IDbCommand cmd = _db.CreateCommand("vc_SelectNewsPublishedInThreadByNewsID", true);
			_db.AddParameter(cmd, "PageIndex", DbType.Int32, PageIndex);
			_db.AddParameter(cmd, "PageNums", DbType.Int32, PageNums);
			_db.AddParameter(cmd, "NewsID", DbType.Int64, NewsID);
			DataTable dataTable = CreateDataTable(cmd);
			return dataTable;
		}
		/// <summary>
		/// 
		/// </summary>
		/// <param name="Cat_ID"></param>
		/// <returns></returns>
		public DataTable vc_selectSitePath(Int32 Cat_ID)
		{
			IDbCommand cmd = _db.CreateCommand("vc_selectSitePath", true);
			_db.AddParameter(cmd, "Cat_ID", DbType.Int32, Cat_ID);
			DataTable dataTable = CreateDataTable(cmd);
			return dataTable;
		}

		public DataTable vc_SelectNewsPublishedInDate_Paged(String Cat_ParentID, Int32 PageIndex, Int32 PageNums, String Cat_ID, String NewsPublishedDate)
		{
			IDbCommand cmd = _db.CreateCommand("vc_SelectNewsPublishedInDate_Paged", true);
			_db.AddParameter(cmd, "Cat_ParentID", DbType.String, Cat_ParentID);
			_db.AddParameter(cmd, "PageIndex", DbType.Int32, PageIndex);
			_db.AddParameter(cmd, "PageNums", DbType.Int32, PageNums);
			_db.AddParameter(cmd, "Cat_ID", DbType.String, Cat_ID);
			_db.AddParameter(cmd, "NewsPublishedDate", DbType.String, NewsPublishedDate);
			DataTable dataTable = CreateDataTable(cmd);
			return dataTable;
		}
		public DataTable vc_SelectNewsPublishedInDate(String Cat_ParentID, Int32 PageIndex, Int32 PageNums, String Cat_ID, String NewsPublishedDate)
		{
			IDbCommand cmd = _db.CreateCommand("vc_SelectNewsPublishedInDate", true);
			_db.AddParameter(cmd, "Cat_ParentID", DbType.String, Cat_ParentID);
			_db.AddParameter(cmd, "PageIndex", DbType.Int32, PageIndex);
			_db.AddParameter(cmd, "PageNums", DbType.Int32, PageNums);
			_db.AddParameter(cmd, "Cat_ID", DbType.String, Cat_ID);
			_db.AddParameter(cmd, "NewsPublishedDate", DbType.String, NewsPublishedDate);
			DataTable dataTable = CreateDataTable(cmd);
			return dataTable;
		}

		/// <summary>
		/// 
		/// </summary>
		/// <param name="Rank_Postion"></param>
		/// <returns></returns>

		public DataTable News_GetListNew(string Where, string cpmode, string Reciver_ID, string Sender_ID, string StartIndex, string PageSize, string SortExpression)
		{
			IDbCommand cmd = _db.CreateCommand("News_GetListNew", true);
			_db.AddParameter(cmd, "Where", DbType.String, Where);
			_db.AddParameter(cmd, "cpmode", DbType.String, cpmode);
			_db.AddParameter(cmd, "Reciver_ID", DbType.String, Reciver_ID);
			_db.AddParameter(cmd, "Sender_ID", DbType.String, Sender_ID);
			_db.AddParameter(cmd, "StartIndex", DbType.String, StartIndex);
			_db.AddParameter(cmd, "PageSize", DbType.String, PageSize);
			_db.AddParameter(cmd, "SortExpression", DbType.String, SortExpression);
			DataTable dataTable = CreateDataTable(cmd);
			return dataTable;
		}


		public DataTable News_GetListNewNumRow(string Where, string cpmode, string Reciver_ID, string Sender_ID)
		{
			IDbCommand cmd = _db.CreateCommand("News_GetListNewNumRows", true);
			_db.AddParameter(cmd, "Where", DbType.String, Where);
			_db.AddParameter(cmd, "cpmode", DbType.String, cpmode);
			_db.AddParameter(cmd, "Reciver_ID", DbType.String, Reciver_ID);
			_db.AddParameter(cmd, "Sender_ID", DbType.String, Sender_ID);
			DataTable dataTable = CreateDataTable(cmd);
			return dataTable;
		}

		public bool News_isLastAccessUser(long newsID, string userName)
		{
			IDbCommand cmd = _db.CreateCommand("News_isLastAccessUser", true);
			_db.AddParameter(cmd, "newsID", DbType.Int64, newsID);
			_db.AddParameter(cmd, "userName", DbType.String, userName);
			return (int)cmd.ExecuteScalar() == 1;
		}
		public bool News_isHasPermissionEdit(long newsID, string inCats)
		{
			IDbCommand cmd = _db.CreateCommand("News_isHasPermissionEdit", true);
			_db.AddParameter(cmd, "newsID", DbType.Int64, newsID);
			_db.AddParameter(cmd, "inCats", DbType.String, inCats);
			return (int)cmd.ExecuteScalar() == 1;
		}

		public DataTable vc_SelectVote_Assign__NewsId_ByVoteId(int Vote_ID)
		{
			IDbCommand cmd = _db.CreateCommand("vc_SelectVote_Assign__NewsId_ByVoteId", true);
			_db.AddParameter(cmd, "Vote_ID", DbType.Int32, Vote_ID);
			DataTable dataTable = CreateDataTable(cmd);
			return dataTable;
		}

		public DataTable vc_SelectNews_Medias_Film_ByFilm_ID(int Film_ID)
		{
			IDbCommand cmd = _db.CreateCommand("vc_SelectNews_Medias_Film_ByFilm_ID", true);
			_db.AddParameter(cmd, "Film_ID", DbType.Int32, Film_ID);
			DataTable dataTable = CreateDataTable(cmd);
			return dataTable;
		}

		public DataTable vc_DeleteNews_Medias_Film_ByFilm_ID(Int32 Film_ID)
		{
			IDbCommand cmd = _db.CreateCommand("vc_DeleteNews_Medias_Film_ByFilm_ID", true);
			_db.AddParameter(cmd, "Film_ID", DbType.Int32, Film_ID);
			DataTable dataTable = CreateDataTable(cmd);
			return dataTable;
		}

		public DataTable vc_DeleteVote_Assigns_News_ByVote_ID(Int32 Vote_ID)
		{
			IDbCommand cmd = _db.CreateCommand("vc_DeleteVote_Assigns_News_ByVote_ID", true);
			_db.AddParameter(cmd, "Vote_ID", DbType.Int32, Vote_ID);
			DataTable dataTable = CreateDataTable(cmd);
			return dataTable;
		}

		public DataTable vc_SelectRankMusicTableFocus(Int32 Rank_Postion)
		{
			IDbCommand cmd = _db.CreateCommand("vc_SelectRankMusicTableFocus", true);
			_db.AddParameter(cmd, "Rank_Postion", DbType.Int32, Rank_Postion);
			DataTable dataTable = CreateDataTable(cmd);
			return dataTable;
		}
		/// <summary>
		/// 
		/// </summary>
		/// <param name="Film_ID"></param>
		/// <returns></returns>
		public DataTable vc_selectFilmMediaObject(Int32 Film_ID)
		{
			IDbCommand cmd = _db.CreateCommand("vc_selectFilmMediaObject", true);
			_db.AddParameter(cmd, "Film_ID", DbType.Int32, Film_ID);
			DataTable dataTable = CreateDataTable(cmd);
			return dataTable;
		}




		/// <summary>
		/// 
		/// </summary>
		/// <param name="DateShow"></param>
		/// <returns></returns>
		public DataTable vc_SelectSchedule_VTVByDateShow(DateTime DateShow)
		{
			IDbCommand cmd = _db.CreateCommand("vc_SelectSchedule_VTVByDateShow", true);
			_db.AddParameter(cmd, "DateShow", DbType.DateTime, DateShow);
			DataTable dataTable = CreateDataTable(cmd);
			return dataTable;
		}

		/// <summary>a
		/// 
		/// </summary>
		/// <param name="DateShow"></param>
		/// <param name="VTVID"></param>
		/// <returns></returns>
		public DataTable vc_SelectSchedule_VTVFilmByDateShow(DateTime DateShow, Int32 VTVID)
		{
			IDbCommand cmd = _db.CreateCommand("vc_SelectSchedule_VTVFilmByDateShow", true);
			_db.AddParameter(cmd, "DateShow", DbType.DateTime, DateShow);
			_db.AddParameter(cmd, "VTVID", DbType.Int32, VTVID);
			DataTable dataTable = CreateDataTable(cmd);
			return dataTable;
		}

		/// <summary>
		/// 
		/// </summary>
		/// <returns></returns>
		public DataTable vc_SelectTopRankFilmsHollyWood()
		{
			IDbCommand cmd = _db.CreateCommand("vc_SelectTopRankFilmsHollyWood", true);
			DataTable dataTable = CreateDataTable(cmd);
			return dataTable;
		}
		/// <summary>
		/// 
		/// </summary>
		/// <param name="dateshow"></param>
		/// <returns></returns>
		public DataTable vc_SelectSchedule_CityByDateShow(DateTime dateshow)
		{
			IDbCommand cmd = _db.CreateCommand("vc_SelectSchedule_CityByDateShow", true);
			_db.AddParameter(cmd, "dateshow", DbType.DateTime, dateshow);
			DataTable dataTable = CreateDataTable(cmd);
			return dataTable;
		}
		/// <summary>
		/// 
		/// </summary>
		/// <param name="dateshow"></param>
		/// <param name="CityID"></param>
		/// <param name="CinameID"></param>
		/// <returns></returns>
		public DataTable vc_SelectSchedule_FilmByDateShow(DateTime dateshow, int CityID, int CinameID)
		{
			IDbCommand cmd = _db.CreateCommand("vc_SelectSchedule_FilmByDateShow", true);
			_db.AddParameter(cmd, "dateshow", DbType.DateTime, dateshow);
			_db.AddParameter(cmd, "CityID", DbType.Int32, CityID);
			_db.AddParameter(cmd, "CinameID", DbType.Int32, CinameID);
			DataTable dataTable = CreateDataTable(cmd);
			return dataTable;
		}
		/// <summary>
		/// 
		/// </summary>
		/// <param name="dateshow"></param>
		/// <param name="FilmID"></param>
		/// <param name="CinameID"></param>
		/// <returns></returns>
		public DataTable vc_SelectSchedule_TimeByFilm(DateTime dateshow, int FilmID, int CinameID)
		{
			IDbCommand cmd = _db.CreateCommand("vc_SelectSchedule_TimeByFilm", true);
			_db.AddParameter(cmd, "dateshow", DbType.DateTime, dateshow);
			_db.AddParameter(cmd, "FilmID", DbType.Int32, FilmID);
			_db.AddParameter(cmd, "CinameID", DbType.Int32, CinameID);
			DataTable dataTable = CreateDataTable(cmd);
			return dataTable;
		}
		/// <summary>
		/// 
		/// </summary>
		/// <param name="dateshow"></param>
		/// <param name="CityID"></param>
		/// <returns></returns>
		public DataTable vc_SelectSchedule__CinemaByDateShow(DateTime dateshow, int CityID)
		{
			IDbCommand cmd = _db.CreateCommand("vc_SelectSchedule-CinemaByDateShow", true);
			_db.AddParameter(cmd, "dateshow", DbType.DateTime, dateshow);
			_db.AddParameter(cmd, "CityID", DbType.Int32, CityID);
			DataTable dataTable = CreateDataTable(cmd);
			return dataTable;
		}

		/// <summary>
		/// 
		/// </summary>
		/// <returns></returns>
		public DataTable vc_SelectTopRankFilmsOther()
		{
			IDbCommand cmd = _db.CreateCommand("vc_SelectTopRankFilmsOther", true);
			DataTable dataTable = CreateDataTable(cmd);
			return dataTable;
		}

		public DataTable vc_SelectNewsPublishedTopClick(String Cat_ParentID, String Cat_ID, Int32 Top)
		{
			IDbCommand cmd = _db.CreateCommand("vc_SelectNewsPublishedTopClick", true);
			_db.AddParameter(cmd, "Cat_ParentID", DbType.String, Cat_ParentID);
			_db.AddParameter(cmd, "Cat_ID", DbType.String, Cat_ID);
			_db.AddParameter(cmd, "Top", DbType.Int32, Top);
			DataTable dataTable = CreateDataTable(cmd);
			return dataTable;
		}
		public DataTable vc_SelectNewsPublishedTopNew()
		{
			IDbCommand cmd = _db.CreateCommand("vc_SelectNewsPublishedTopNew", true);
			DataTable dataTable = CreateDataTable(cmd);
			return dataTable;
		}
		/// <summary>
		/// Create By Thien:lay cac tin tieu diem theo category
		/// </summary>
		/// <param name="Cat_ID"></param>
		/// <param name="Top"></param>
		/// <returns></returns>
		public DataTable vc_SelectNewsPublishedIsFocus(String Cat_ID, String Top)
		{
			IDbCommand cmd = _db.CreateCommand("vc_SelectNewsPublishedIsFocus", true);
			_db.AddParameter(cmd, "Cat_ID", DbType.String, Cat_ID);
			_db.AddParameter(cmd, "Top", DbType.String, Top);
			DataTable dataTable = CreateDataTable(cmd);
			return dataTable;
		}
		public DataTable SelectLatestNewsPublished(String Cat_ID, String Top)
		{
			IDbCommand cmd = _db.CreateCommand("SelectLatestNewsPublished", true);
			_db.AddParameter(cmd, "Cat_ID", DbType.String, Cat_ID);
			_db.AddParameter(cmd, "Top", DbType.String, Top);
			DataTable dataTable = CreateDataTable(cmd);
			return dataTable;
		}

		/// <summary>
		/// Create By Thien TD : Lay nhung tin theo Thread.
		/// </summary>
		/// <param name="ThreadID"></param>
		/// <param name="Top"></param>
		/// <returns></returns>
		public DataTable vc_SelectNewsPublishedByThread(String ThreadID, String Top)
		{
			IDbCommand cmd = _db.CreateCommand("vc_SelectNewsPublishedByThread", true);
			_db.AddParameter(cmd, "ThreadID", DbType.String, ThreadID);
			_db.AddParameter(cmd, "Top", DbType.String, Top);
			DataTable dataTable = CreateDataTable(cmd);
			return dataTable;
		}

		/// <summary>
		/// 
		/// </summary>
		/// <param name="News_Mode"></param>
		/// <param name="ParentID"></param>
		/// <param name="Row"></param>
		/// <param name="Cat_ID"></param>
		/// <returns></returns>
		public DataTable vc_SelectNewsPublishedByCat_ParentID(String News_Mode, String ParentID, String Row, String Cat_ID)
		{
			IDbCommand cmd = _db.CreateCommand("vc_SelectNewsPublishedByCat_ParentID", true);
			_db.AddParameter(cmd, "News_Mode", DbType.String, News_Mode);
			_db.AddParameter(cmd, "ParentID", DbType.String, ParentID);
			_db.AddParameter(cmd, "Row", DbType.String, Row);
			_db.AddParameter(cmd, "Cat_ID", DbType.String, Cat_ID);
			DataTable dataTable = CreateDataTable(cmd);
			return dataTable;
		}

		/// <summary>
		/// Create by Thien
		/// </summary>
		/// <param name="News_PublishDate"></param>
		/// <param name="TopSelect"></param>
		/// <param name="Cat_ParentID"></param>
		/// <param name="Cat_ID"></param>
		/// <returns></returns>
		public DataTable vc_SelectNewsPublishedOtherNews(String Cat_ParentID, String TopSelect, String NewsID, String News_PublishDate, String Cat_ID)
		{
			IDbCommand cmd = _db.CreateCommand("vc_SelectNewsPublishedOtherNews", true);
			_db.AddParameter(cmd, "Cat_ParentID", DbType.String, Cat_ParentID);
			_db.AddParameter(cmd, "TopSelect", DbType.String, TopSelect);
			_db.AddParameter(cmd, "NewsID", DbType.String, NewsID);
			_db.AddParameter(cmd, "News_PublishDate", DbType.String, News_PublishDate);
			_db.AddParameter(cmd, "Cat_ID", DbType.String, Cat_ID);
			DataTable dataTable = CreateDataTable(cmd);
			return dataTable;
		}


		//Created by ThanhNQ--------------------------------------------------------------------------------       
		public DataTable vc_SelectRandomFilmID(String top)
		{
			IDbCommand cmd = _db.CreateCommand("vc_SelectRandomFilmID", true);
			_db.AddParameter(cmd, "top", DbType.String, top);
			DataTable dataTable = CreateDataTable(cmd);
			return dataTable;
		}

		public DataTable vc_SelectFilmByCinemaID(Int32 CinemaID)
		{
			IDbCommand cmd = _db.CreateCommand("vc_SelectFilmByCinemaID", true);
			_db.AddParameter(cmd, "CinemaID", DbType.Int32, CinemaID);
			DataTable dataTable = CreateDataTable(cmd);
			return dataTable;
		}

		public DataTable vc_SelectTrailerByFilmID(Int32 FilmID)
		{
			IDbCommand cmd = _db.CreateCommand("vc_SelectTrailerByFilmID", true);
			_db.AddParameter(cmd, "FilmID", DbType.Int32, FilmID);
			DataTable dataTable = CreateDataTable(cmd);
			return dataTable;
		}

		public DataTable vc_SelectFilmTimeBegin_End(Int32 CinemaID, Int32 FilmID)
		{
			IDbCommand cmd = _db.CreateCommand("vc_SelectFilmTimeBegin_End", true);
			_db.AddParameter(cmd, "CinemaID", DbType.Int32, CinemaID);
			_db.AddParameter(cmd, "FilmID", DbType.Int32, FilmID);
			DataTable dataTable = CreateDataTable(cmd);
			return dataTable;
		}

		public DataTable vc_SelectNewsPublishedTopVote(String Cat_ParentID, String Cat_ID, int Top)
		{
			IDbCommand cmd = _db.CreateCommand("vc_SelectNewsPublishedTopVote", true);
			_db.AddParameter(cmd, "Cat_ParentID", DbType.String, Cat_ParentID);
			_db.AddParameter(cmd, "Cat_ID", DbType.String, Cat_ID);
			_db.AddParameter(cmd, "Top", DbType.Int32, Top);
			DataTable dataTable = CreateDataTable(cmd);
			return dataTable;
		}

		public DataTable vc_InsertRate(Int32 Mark, Int64 NewsID)
		{
			IDbCommand cmd = _db.CreateCommand("vc_InsertRate", true);
			_db.AddParameter(cmd, "Mark", DbType.Int32, Mark);
			_db.AddParameter(cmd, "NewsID", DbType.Int64, NewsID);
			DataTable dataTable = CreateDataTable(cmd);
			return dataTable;
		}

		public DataTable vc_SelectRateByNewsID(Int64 NewsID)
		{
			IDbCommand cmd = _db.CreateCommand("vc_SelectRateByNewsID", true);
			_db.AddParameter(cmd, "NewsID", DbType.Int64, NewsID);
			DataTable dataTable = CreateDataTable(cmd);
			return dataTable;
		}

		public DataTable vc_SelectNewsPublishedObjectMedia(Int64 News_ID)
		{
			IDbCommand cmd = _db.CreateCommand("vc_SelectNewsPublishedObjectMedia", true);
			_db.AddParameter(cmd, "News_ID", DbType.Int64, News_ID);
			DataTable dataTable = CreateDataTable(cmd);
			return dataTable;
		}
		/// <summary>
		/// 
		/// </summary>
		/// <param name="Cat_ParentID"></param>
		/// <param name="PageIndex"></param>
		/// <param name="PageNums"></param>
		/// <param name="Cat_ID"></param>
		/// <returns></returns>
		public DataTable vc_SelectNewsPublished_Paged(String Cat_ParentID, Int32 PageIndex, Int32 PageNums, String Cat_ID)
		{
			IDbCommand cmd = _db.CreateCommand("vc_SelectNewsPublished_Paged", true);
			_db.AddParameter(cmd, "Cat_ParentID", DbType.String, Cat_ParentID);
			_db.AddParameter(cmd, "PageIndex", DbType.Int32, PageIndex);
			_db.AddParameter(cmd, "PageNums", DbType.Int32, PageNums);
			_db.AddParameter(cmd, "Cat_ID", DbType.String, Cat_ID);
			DataTable dataTable = CreateDataTable(cmd);
			return dataTable;
		}

		//HienTV Created
		//Used for ScheduleList
		public DataTable vc_GetListScheduleToCaculateTotalRows(string Keyword)
		{
			IDbCommand cmd = _db.CreateCommand("vc_GetListScheduleToCaculateTotalRows", true);
			_db.AddParameter(cmd, "Keyword", DbType.String, Keyword);
			DataTable dataTable = CreateDataTable(cmd);
			return dataTable;
		}
		/// <summary>
		/// 
		/// </summary>
		/// <param name="Keyword"></param>
		/// <param name="PageNum"></param>
		/// <param name="PageSize"></param>
		/// <returns></returns>
		public DataTable vc_GetListSchedule(string Keyword, int PageNum, int PageSize)
		{
			IDbCommand cmd = _db.CreateCommand("vc_GetListSchedule", true);
			_db.AddParameter(cmd, "Keyword", DbType.String, Keyword);
			_db.AddParameter(cmd, "PageNum", DbType.Int32, PageNum);
			_db.AddParameter(cmd, "PageSize", DbType.Int32, PageSize);
			DataTable dataTable = CreateDataTable(cmd);
			return dataTable;
		}

		/// <summary>
		/// 
		/// </summary>
		/// <param name="Cat_ParentID"></param>
		/// <param name="Cat_ID"></param>
		/// <returns></returns>
		public DataTable vc_CountNewsPublishedRecord(String Cat_ParentID, String Cat_ID)
		{
			IDbCommand cmd = _db.CreateCommand("vc_CountNewsPublishedRecord", true);
			_db.AddParameter(cmd, "Cat_ParentID", DbType.String, Cat_ParentID);
			_db.AddParameter(cmd, "Cat_ID", DbType.String, Cat_ID);
			DataTable dataTable = CreateDataTable(cmd);
			return dataTable;
		}
		/// <summary>
		/// 
		/// </summary>
		/// <param name="Number"></param>
		/// <param name="OrderByExpression"></param>
		/// <param name="WhereCondition"></param>
		/// <returns></returns>
		public DataTable vc_SelectTopNewsPublishedsDynamic(String Number, String OrderByExpression, String WhereCondition)
		{
			IDbCommand cmd = _db.CreateCommand("vc_SelectTopNewsPublishedsDynamic", true);
			_db.AddParameter(cmd, "Number", DbType.String, Number);
			_db.AddParameter(cmd, "OrderByExpression", DbType.String, OrderByExpression);
			_db.AddParameter(cmd, "WhereCondition", DbType.String, WhereCondition);
			DataTable dataTable = CreateDataTable(cmd);
			return dataTable;
		}
		/// <summary>
		/// 
		/// </summary>
		/// <param name="NewsID"></param>
		/// <returns></returns>
		public DataTable vc_SelectSurveyByNewsID(Int64 NewsID)
		{
			IDbCommand cmd = _db.CreateCommand("vc_SelectSurveyByNewsID", true);
			_db.AddParameter(cmd, "NewsID", DbType.Int64, NewsID);
			DataTable dataTable = CreateDataTable(cmd);
			return dataTable;
		}
		/// <summary>
		/// 
		/// </summary>
		/// <returns></returns>
		public DataTable vc_SelectSurveyQuestionNow()
		{
			IDbCommand cmd = _db.CreateCommand("vc_SelectSurveyQuestionNow", true);
			DataTable dataTable = CreateDataTable(cmd);
			return dataTable;
		}
		/// <summary>
		/// 
		/// </summary>
		/// <returns></returns>
		public DataTable vc_SelectSurveyLastestEnd()
		{
			IDbCommand cmd = _db.CreateCommand("vc_SelectSurveyLastestEnd", true);
			DataTable dataTable = CreateDataTable(cmd);
			return dataTable;
		}
		/// <summary>
		/// 
		/// </summary>
		/// <param name="Top"></param>
		/// <returns></returns>
		public DataTable vc_SelectSurveyEnd(String Top)
		{
			IDbCommand cmd = _db.CreateCommand("vc_SelectSurveyEnd", true);
			_db.AddParameter(cmd, "Top", DbType.String, Top);
			DataTable dataTable = CreateDataTable(cmd);
			return dataTable;
		}
		//----------------------------------------------------------------------------------------


		public DataTable vc_InsertComment(Int32 Film_ID, Int64 News_ID, String Comment_Content, Decimal Comment_Rate, DateTime Comment_Date, String Comment_User, Boolean Comment_Approved, String Comment_Email, Int32 SP_ID)
		{
			IDbCommand cmd = _db.CreateCommand("vc_InsertComment", true);
			_db.AddParameter(cmd, "Film_ID", DbType.Int32, Film_ID);
			_db.AddParameter(cmd, "News_ID", DbType.Int64, News_ID);
			_db.AddParameter(cmd, "Comment_Content", DbType.String, Comment_Content);
			_db.AddParameter(cmd, "Comment_Rate", DbType.Decimal, Comment_Rate);
			_db.AddParameter(cmd, "Comment_Date", DbType.DateTime, Comment_Date);
			_db.AddParameter(cmd, "Comment_User", DbType.String, Comment_User);
			_db.AddParameter(cmd, "Comment_Approved", DbType.Boolean, Comment_Approved);
			_db.AddParameter(cmd, "Comment_Email", DbType.String, Comment_Email);
			_db.AddParameter(cmd, "SP_ID", DbType.Int32, SP_ID);
			DataTable dataTable = CreateDataTable(cmd);
			return dataTable;
		}

		public DataTable vc_InsertNews_Media(Int64 News_ID, String UseAvatar, Int32 Object_ID, String Use_Note, Int32 Film_ID)
		{
			IDbCommand cmd = _db.CreateCommand("vc_InsertNews_Media", true);
			_db.AddParameter(cmd, "News_ID", DbType.Int64, News_ID);
			_db.AddParameter(cmd, "UseAvatar", DbType.String, UseAvatar);
			_db.AddParameter(cmd, "Object_ID", DbType.Int32, Object_ID);
			_db.AddParameter(cmd, "Use_Note", DbType.String, Use_Note);
			_db.AddParameter(cmd, "Film_ID", DbType.Int32, Film_ID);
			DataTable dataTable = CreateDataTable(cmd);
			return dataTable;
		}

		public DataTable vc_InsertVote_Assign(String News_ID, Int32 Vote_ID, String Vote_GenTag, Int32 Cat_ID)
		{
			IDbCommand cmd = _db.CreateCommand("vc_InsertVote_Assign", true);
			_db.AddParameter(cmd, "News_ID", DbType.String, News_ID);
			_db.AddParameter(cmd, "Vote_ID", DbType.Int32, Vote_ID);
			_db.AddParameter(cmd, "Vote_GenTag", DbType.String, Vote_GenTag);
			_db.AddParameter(cmd, "Cat_ID", DbType.Int32, Cat_ID);
			DataTable dataTable = CreateDataTable(cmd);
			return dataTable;
		}

		public DataTable vc_SelectCommentsDynamic(String OrderByExpression, String WhereCondition)
		{
			IDbCommand cmd = _db.CreateCommand("vc_SelectCommentsDynamic", true);
			_db.AddParameter(cmd, "OrderByExpression", DbType.String, OrderByExpression);
			_db.AddParameter(cmd, "WhereCondition", DbType.String, WhereCondition);
			DataTable dataTable = CreateDataTable(cmd);
			return dataTable;
		}

		public DataTable vc_SelectNewsPublishedsDynamic(String OrderByExpression, String WhereCondition)
		{
			IDbCommand cmd = _db.CreateCommand("vc_SelectNewsPublishedsDynamic", true);
			_db.AddParameter(cmd, "OrderByExpression", DbType.String, OrderByExpression);
			_db.AddParameter(cmd, "WhereCondition", DbType.String, WhereCondition);
			DataTable dataTable = CreateDataTable(cmd);
			return dataTable;
		}

		//Create by ThienTD
		public DataTable vc_SelectNewsPublishedsDynamicJoinCategory(Int64 NewsID, String OrderByExpression, String WhereCondition)
		{
			IDbCommand cmd = _db.CreateCommand("vc_SelectNewsPublishedsDynamicJoinCategory", true);
			_db.AddParameter(cmd, "NewsID", DbType.Int64, NewsID);
			_db.AddParameter(cmd, "OrderByExpression", DbType.String, OrderByExpression);
			_db.AddParameter(cmd, "WhereCondition", DbType.String, WhereCondition);
			DataTable dataTable = CreateDataTable(cmd);
			return dataTable;
		}


		public DataTable vc_SelectVotesDynamic(String OrderByExpression, String WhereCondition)
		{
			IDbCommand cmd = _db.CreateCommand("vc_SelectVotesDynamic", true);
			_db.AddParameter(cmd, "OrderByExpression", DbType.String, OrderByExpression);
			_db.AddParameter(cmd, "WhereCondition", DbType.String, WhereCondition);
			DataTable dataTable = CreateDataTable(cmd);
			return dataTable;
		}

		/// <summary>
		/// 
		/// </summary>
		/// <param name="LogObject_Id"></param>
		/// <param name="LogType"></param>
		/// <param name="LogDate"></param>
		/// <returns></returns>

		/// <summary>
		/// 
		/// </summary>
		/// <param name="Cats"></param>
		/// <param name="top"></param>
		/// <returns></returns>
		public DataTable vc_SelectNewsPublishedMultiFocus(String Cats, Int32 top)
		{
			IDbCommand cmd = _db.CreateCommand("vc_SelectNewsPublishedMultiFocus", true);
			_db.AddParameter(cmd, "Cats", DbType.String, Cats);
			_db.AddParameter(cmd, "top", DbType.Int32, top);
			DataTable dataTable = CreateDataTable(cmd);
			return dataTable;
		}
		/// <summary>
		/// 
		/// </summary>
		/// <param name="Table_ID"></param>
		/// <returns></returns>
		public DataTable vc_selectRankTableMusicByDate(Int32 Table_ID)
		{
			IDbCommand cmd = _db.CreateCommand("vc_selectRankTableMusicByDate", true);
			_db.AddParameter(cmd, "Table_ID", DbType.Int32, Table_ID);
			DataTable dataTable = CreateDataTable(cmd);
			return dataTable;
		}
		/// <summary>
		/// 
		/// </summary>
		/// <param name="Rank_LastUpdated"></param>
		/// <param name="Table_ID"></param>
		/// <returns></returns>
		public DataTable vc_selectRankMusic(DateTime Rank_LastUpdated, Int32 Table_ID)
		{
			IDbCommand cmd = _db.CreateCommand("vc_selectRankMusic", true);
			_db.AddParameter(cmd, "Rank_LastUpdated", DbType.DateTime, Rank_LastUpdated);
			_db.AddParameter(cmd, "Table_ID", DbType.Int32, Table_ID);
			DataTable dataTable = CreateDataTable(cmd);
			return dataTable;
		}
		/// <summary>
		/// 
		/// </summary>
		/// <param name="Cat_ParentID"></param>
		/// <param name="Cat_ID"></param>
		/// <param name="NewsPublishedDate"></param>
		/// <returns></returns>
		public DataTable vc_CountNewsPublishedInDateRecord(String Cat_ParentID, String Cat_ID, String NewsPublishedDate)
		{
			IDbCommand cmd = _db.CreateCommand("vc_CountNewsPublishedInDateRecord", true);
			_db.AddParameter(cmd, "Cat_ParentID", DbType.String, Cat_ParentID);
			_db.AddParameter(cmd, "Cat_ID", DbType.String, Cat_ID);
			_db.AddParameter(cmd, "NewsPublishedDate", DbType.String, NewsPublishedDate);
			DataTable dataTable = CreateDataTable(cmd);
			return dataTable;
		}
		/// <summary>
		/// 
		/// </summary>
		/// <param name="News_ID"></param>
		/// <returns></returns>
		public DataTable vc_selectFilmByNewsID(Int64 News_ID)
		{
			IDbCommand cmd = _db.CreateCommand("vc_selectFilmByNewsID", true);
			_db.AddParameter(cmd, "News_ID", DbType.Int64, News_ID);
			DataTable dataTable = CreateDataTable(cmd);
			return dataTable;
		}
		/// <summary>
		/// 
		/// </summary>
		/// <param name="FilmID"></param>
		/// <returns></returns>
		public DataTable vc_selectNewsPublishByFilmID(Int32 FilmID)
		{
			IDbCommand cmd = _db.CreateCommand("vc_selectNewsPublishByFilmID", true);
			_db.AddParameter(cmd, "FilmID", DbType.Int32, FilmID);
			DataTable dataTable = CreateDataTable(cmd);
			return dataTable;
		}

		public DataTable vcc_ListAllCommentByNewsID_Approve(String News_ID, Boolean Comment_Approved)
		{
			IDbCommand cmd = _db.CreateCommand("vcc_ListAllCommentByNewsID_Approve", true);
			_db.AddParameter(cmd, "News_ID", DbType.String, News_ID);
			_db.AddParameter(cmd, "Comment_Approved", DbType.Boolean, Comment_Approved);
			DataTable dataTable = CreateDataTable(cmd);
			return dataTable;
		}

		public DataTable vcc_ListAllComment()
		{
			IDbCommand cmd = _db.CreateCommand("vcc_ListAllComment", true);
			DataTable dataTable = CreateDataTable(cmd);
			return dataTable;
		}

		public DataTable vcc_ListAllComment_Approved(Boolean Comment_Approved)
		{
			IDbCommand cmd = _db.CreateCommand("vcc_ListAllComment_Approved", true);
			_db.AddParameter(cmd, "Comment_Approved", DbType.Boolean, Comment_Approved);
			DataTable dataTable = CreateDataTable(cmd);
			return dataTable;
		}

		public DataTable vc_SelectCommentByID(Int64 Comment_ID)
		{
			IDbCommand cmd = _db.CreateCommand("vc_SelectCommentByID", true);
			_db.AddParameter(cmd, "iComment_ID", DbType.Int64, Comment_ID);
			DataTable dataTable = CreateDataTable(cmd);
			return dataTable;
		}

		public DataTable vcc_DeleteCommentByID(String Comment_ID)
		{
			IDbCommand cmd = _db.CreateCommand("vcc_DeleteCommentByID", true);
			_db.AddParameter(cmd, "Comment_ID", DbType.String, Comment_ID);
			DataTable dataTable = CreateDataTable(cmd);
			return dataTable;
		}

		public DataTable vcc_UpdateCommentByID(String Comment_ID)
		{
			IDbCommand cmd = _db.CreateCommand("vcc_UpdateCommentByID", true);
			_db.AddParameter(cmd, "Comment_ID", DbType.String, Comment_ID);
			DataTable dataTable = CreateDataTable(cmd);
			return dataTable;
		}

		public DataTable vcc_UpdateCommentByStaff(String Comment_Content, String Comment_ID)
		{
			IDbCommand cmd = _db.CreateCommand("vcc_UpdateCommentByStaff", true);
			_db.AddParameter(cmd, "Comment_Content", DbType.String, Comment_Content);
			_db.AddParameter(cmd, "Comment_ID", DbType.String, Comment_ID);
			DataTable dataTable = CreateDataTable(cmd);
			return dataTable;
		}



		public DataTable vcc_AdminSearchCommentByKeyword(string Where, string StartIndex, string PageSize)
		{
			IDbCommand cmd = _db.CreateCommand("vcc_AdminSearchCommentByKeyword", true);
			_db.AddParameter(cmd, "where", DbType.String, Where);
			_db.AddParameter(cmd, "StartIndex", DbType.String, StartIndex);
			_db.AddParameter(cmd, "PageSize", DbType.String, PageSize);

			DataTable dataTable = CreateDataTable(cmd);
			return dataTable;
		}

		public DataTable vcc_CountAdminSearchCommentByKeyword(string Where)
		{
			IDbCommand cmd = _db.CreateCommand("vcc_CountAdminSearchCommentByKeyword", true);
			_db.AddParameter(cmd, "where", DbType.String, Where);
			DataTable dataTable = CreateDataTable(cmd);
			return dataTable;
		}

		public DataTable Comment_GetCommentNotRead(string Where, string StartIndex, string PageSize)
		{
			IDbCommand cmd = _db.CreateCommand("Comment_GetCommentNotRead", true);
			_db.AddParameter(cmd, "where", DbType.String, Where);
			_db.AddParameter(cmd, "StartIndex", DbType.String, StartIndex);
			_db.AddParameter(cmd, "PageSize", DbType.String, PageSize);

			DataTable dataTable = CreateDataTable(cmd);
			return dataTable;
		}

		public DataTable Comment_CountGetCommentNotRead(string Where)
		{
			IDbCommand cmd = _db.CreateCommand("Comment_CountGetCommentNotRead", true);
			_db.AddParameter(cmd, "where", DbType.String, Where);
			DataTable dataTable = CreateDataTable(cmd);
			return dataTable;
		}

		public DataTable Comment_GetCommentRead(string Where, string StartIndex, string PageSize)
		{
			IDbCommand cmd = _db.CreateCommand("Comment_GetCommentRead", true);
			_db.AddParameter(cmd, "where", DbType.String, Where);
			_db.AddParameter(cmd, "StartIndex", DbType.String, StartIndex);
			_db.AddParameter(cmd, "PageSize", DbType.String, PageSize);

			DataTable dataTable = CreateDataTable(cmd);
			return dataTable;
		}

		public DataTable Comment_CountGetCommentRead(string Where)
		{
			IDbCommand cmd = _db.CreateCommand("Comment_CountGetCommentRead", true);
			_db.AddParameter(cmd, "where", DbType.String, Where);
			DataTable dataTable = CreateDataTable(cmd);
			return dataTable;
		}


		public DataTable Comment_FashionGetCommentNotRead(string Where, string StartIndex, string PageSize)
		{
			IDbCommand cmd = _db.CreateCommand("Comment_FashionGetCommentNotRead", true);
			_db.AddParameter(cmd, "where", DbType.String, Where);
			_db.AddParameter(cmd, "StartIndex", DbType.String, StartIndex);
			_db.AddParameter(cmd, "PageSize", DbType.String, PageSize);

			DataTable dataTable = CreateDataTable(cmd);
			return dataTable;
		}

		public DataTable Comment_FashionCountGetCommentNotRead(string Where)
		{
			IDbCommand cmd = _db.CreateCommand("Comment_FashionCountGetCommentNotRead", true);
			_db.AddParameter(cmd, "where", DbType.String, Where);
			DataTable dataTable = CreateDataTable(cmd);
			return dataTable;
		}



		public DataTable CommentFeedBackNews_GetCommentRead(string Where, string StartIndex, string PageSize)
		{
			IDbCommand cmd = _db.CreateCommand("CommentFeedBackNews_GetCommentRead", true);
			_db.AddParameter(cmd, "where", DbType.String, Where);
			_db.AddParameter(cmd, "StartIndex", DbType.String, StartIndex);
			_db.AddParameter(cmd, "PageSize", DbType.String, PageSize);

			DataTable dataTable = CreateDataTable(cmd);
			return dataTable;
		}

		public DataTable CommentFeedBackNews_CountGetCommentRead(string Where)
		{
			IDbCommand cmd = _db.CreateCommand("CommentFeedBackNews_CountGetCommentRead", true);
			_db.AddParameter(cmd, "where", DbType.String, Where);
			DataTable dataTable = CreateDataTable(cmd);
			return dataTable;
		}


		public DataTable CommentFeedBackNews_GetCommentNotRead(string Where, string StartIndex, string PageSize)
		{
			IDbCommand cmd = _db.CreateCommand("CommentFeedBackNews_GetCommentNotRead", true);
			_db.AddParameter(cmd, "where", DbType.String, Where);
			_db.AddParameter(cmd, "StartIndex", DbType.String, StartIndex);
			_db.AddParameter(cmd, "PageSize", DbType.String, PageSize);

			DataTable dataTable = CreateDataTable(cmd);
			return dataTable;
		}

		public DataTable CommentFeedBackNews_CountGetCommentNotRead(string Where)
		{
			IDbCommand cmd = _db.CreateCommand("CommentFeedBackNews_CountGetCommentNotRead", true);
			_db.AddParameter(cmd, "where", DbType.String, Where);
			DataTable dataTable = CreateDataTable(cmd);
			return dataTable;
		}


		public DataTable Comment_FashionGetCommentRead(string Where, string StartIndex, string PageSize)
		{
			IDbCommand cmd = _db.CreateCommand("Comment_FashionGetCommentRead", true);
			_db.AddParameter(cmd, "where", DbType.String, Where);
			_db.AddParameter(cmd, "StartIndex", DbType.String, StartIndex);
			_db.AddParameter(cmd, "PageSize", DbType.String, PageSize);

			DataTable dataTable = CreateDataTable(cmd);
			return dataTable;
		}

		public DataTable Comment_FashionCountGetCommentRead(string Where)
		{
			IDbCommand cmd = _db.CreateCommand("Comment_CountFashionCommentRead", true);
			_db.AddParameter(cmd, "where", DbType.String, Where);
			DataTable dataTable = CreateDataTable(cmd);
			return dataTable;
		}

		//Dành cho bảng Quizzes
		//Author: Nguyễn Anh Tú
		public int vc_CheckExistQuizzes(string Name)
		{
			IDbCommand cmd = _db.CreateCommand("vc_CheckExistQuizzes", true);
			_db.AddParameter(cmd, "Name", DbType.String, Name);
			DataTable dataTable = CreateDataTable(cmd);
			return dataTable.Rows.Count;
		}
		public DataTable vc_SelectQuizzes(string Condition)
		{
			IDbCommand cmd = _db.CreateCommand("vc_SelectQuizzes", true);
			_db.AddParameter(cmd, "Condition", DbType.String, Condition);
			DataTable dataTable = CreateDataTable(cmd);
			return dataTable;
		}
		public DataTable vc_DeleteQuizzes(string ID_Quizz)
		{
			IDbCommand cmd = _db.CreateCommand("vc_DeleteQuizzes", true);
			_db.AddParameter(cmd, "ID_Quizz", DbType.String, ID_Quizz);
			DataTable dataTable = CreateDataTable(cmd);
			return dataTable;
		}
		public DataTable vc_InsertQuizzes(String Name, String Image1, String Image2, Int32 NumberOfAnswer, String Description, bool isActive)
		{
			IDbCommand cmd = _db.CreateCommand("vc_InsertQuizzes", true);
			_db.AddParameter(cmd, "Name", DbType.String, Name);
			_db.AddParameter(cmd, "Image1", DbType.String, Image1);
			_db.AddParameter(cmd, "Image2", DbType.String, Image2);
			_db.AddParameter(cmd, "NumberOfAnswer", DbType.Int32, NumberOfAnswer);
			_db.AddParameter(cmd, "Description", DbType.String, Description);
			_db.AddParameter(cmd, "isActive", DbType.Boolean, isActive);
			DataTable dataTable = CreateDataTable(cmd);
			return dataTable;
		}
		public DataTable vc_UpdateQuizzes(Int32 ID_Quizz, String Name, String Image1, String Image2, Int32 NumberOfAnswer, String Description, bool isActive)
		{
			IDbCommand cmd = _db.CreateCommand("vc_UpdateQuizzes", true);
			_db.AddParameter(cmd, "ID_Quizz", DbType.Int32, ID_Quizz);
			_db.AddParameter(cmd, "Name", DbType.String, Name);
			_db.AddParameter(cmd, "Image1", DbType.String, Image1);
			_db.AddParameter(cmd, "Image2", DbType.String, Image2);
			_db.AddParameter(cmd, "NumberOfAnswer", DbType.Int32, NumberOfAnswer);
			_db.AddParameter(cmd, "Description", DbType.String, Description);
			_db.AddParameter(cmd, "isActive", DbType.Boolean, isActive);
			DataTable dataTable = CreateDataTable(cmd);
			return dataTable;
		}
		public DataTable vc_SetDeactiveQuizzes()
		{
			IDbCommand cmd = _db.CreateCommand("vc_SetDeactiveQuizzes", true);
			DataTable dataTable = CreateDataTable(cmd);
			return dataTable;
		}
		//End Quizzes

		//Dành cho bảng Quizzes_Question
		//Author: Nguyễn Anh Tú
		public DataTable vc_SelectQuizzesQuestion(string Condition)
		{
			IDbCommand cmd = _db.CreateCommand("vc_SelectQuizzesQuestion", true);
			_db.AddParameter(cmd, "Condition", DbType.String, Condition);
			DataTable dataTable = CreateDataTable(cmd);
			return dataTable;
		}
		public DataTable vc_DeleteQuizzesQuestion(string ID_Ques)
		{
			IDbCommand cmd = _db.CreateCommand("vc_DeleteQuizzesQuestion", true);
			_db.AddParameter(cmd, "ID_Ques", DbType.String, ID_Ques);
			DataTable dataTable = CreateDataTable(cmd);
			return dataTable;
		}
		public DataTable vc_InsertQuizzesQuestion(String ID_Quizz, String Question, String Ans_A, String Des_A, String Image_A, String Ans_B, String Des_B, String Image_B, String Ans_C, String Des_C, String Image_C, String Ans_D, String Des_D, String Image_D, String Ans_E, String Des_E, String Image_E, String Ans_F, String Des_F, String Image_F)
		{
			IDbCommand cmd = _db.CreateCommand("vc_InsertQuizzesQuestion", true);
			_db.AddParameter(cmd, "ID_Quizz", DbType.String, ID_Quizz);
			_db.AddParameter(cmd, "Question", DbType.String, Question);
			_db.AddParameter(cmd, "Ans_A", DbType.String, Ans_A);
			_db.AddParameter(cmd, "Des_A", DbType.String, Des_A);
			_db.AddParameter(cmd, "Image_A", DbType.String, Image_A);
			_db.AddParameter(cmd, "Ans_B", DbType.String, Ans_B);
			_db.AddParameter(cmd, "Des_B", DbType.String, Des_B);
			_db.AddParameter(cmd, "Image_B", DbType.String, Image_B);
			_db.AddParameter(cmd, "Ans_C", DbType.String, Ans_C);
			_db.AddParameter(cmd, "Des_C", DbType.String, Des_C);
			_db.AddParameter(cmd, "Image_C", DbType.String, Image_C);
			_db.AddParameter(cmd, "Ans_D", DbType.String, Ans_D);
			_db.AddParameter(cmd, "Des_D", DbType.String, Des_D);
			_db.AddParameter(cmd, "Image_D", DbType.String, Image_D);
			_db.AddParameter(cmd, "Ans_E", DbType.String, Ans_E);
			_db.AddParameter(cmd, "Des_E", DbType.String, Des_E);
			_db.AddParameter(cmd, "Image_E", DbType.String, Image_E);
			_db.AddParameter(cmd, "Ans_F", DbType.String, Ans_F);
			_db.AddParameter(cmd, "Des_F", DbType.String, Des_F);
			_db.AddParameter(cmd, "Image_F", DbType.String, Image_F);
			DataTable dataTable = CreateDataTable(cmd);
			return dataTable;
		}
		public DataTable vc_UpdateQuizzesQuestion(Int32 ID_Ques, String ID_Quizz, String Question, String Ans_A, String Des_A, String Image_A, String Ans_B, String Des_B, String Image_B, String Ans_C, String Des_C, String Image_C, String Ans_D, String Des_D, String Image_D, String Ans_E, String Des_E, String Image_E, String Ans_F, String Des_F, String Image_F)
		{
			IDbCommand cmd = _db.CreateCommand("vc_UpdateQuizzesQuestion", true);
			_db.AddParameter(cmd, "ID_Ques", DbType.Int32, ID_Ques);
			_db.AddParameter(cmd, "ID_Quizz", DbType.String, ID_Quizz);
			_db.AddParameter(cmd, "Question", DbType.String, Question);
			_db.AddParameter(cmd, "Ans_A", DbType.String, Ans_A);
			_db.AddParameter(cmd, "Des_A", DbType.String, Des_A);
			_db.AddParameter(cmd, "Image_A", DbType.String, Image_A);
			_db.AddParameter(cmd, "Ans_B", DbType.String, Ans_B);
			_db.AddParameter(cmd, "Des_B", DbType.String, Des_B);
			_db.AddParameter(cmd, "Image_B", DbType.String, Image_B);
			_db.AddParameter(cmd, "Ans_C", DbType.String, Ans_C);
			_db.AddParameter(cmd, "Des_C", DbType.String, Des_C);
			_db.AddParameter(cmd, "Image_C", DbType.String, Image_C);
			_db.AddParameter(cmd, "Ans_D", DbType.String, Ans_D);
			_db.AddParameter(cmd, "Des_D", DbType.String, Des_D);
			_db.AddParameter(cmd, "Image_D", DbType.String, Image_D);
			_db.AddParameter(cmd, "Ans_E", DbType.String, Ans_E);
			_db.AddParameter(cmd, "Des_E", DbType.String, Des_E);
			_db.AddParameter(cmd, "Image_E", DbType.String, Image_E);
			_db.AddParameter(cmd, "Ans_F", DbType.String, Ans_F);
			_db.AddParameter(cmd, "Des_F", DbType.String, Des_F);
			_db.AddParameter(cmd, "Image_F", DbType.String, Image_F);
			DataTable dataTable = CreateDataTable(cmd);
			return dataTable;
		}


		public DataTable News_GetListNewMyPublished(string Where, string cpmode, string Reciver_ID, string Sender_ID, string StartIndex, string PageSize, string News_Approver, string SortExpression)
		{
			IDbCommand cmd = _db.CreateCommand("News_GetListNewMyPublished", true);
			_db.AddParameter(cmd, "Where", DbType.String, Where);
			_db.AddParameter(cmd, "cpmode", DbType.String, cpmode);
			_db.AddParameter(cmd, "Reciver_ID", DbType.String, Reciver_ID);
			_db.AddParameter(cmd, "Sender_ID", DbType.String, Sender_ID);
			_db.AddParameter(cmd, "StartIndex", DbType.String, StartIndex);
			_db.AddParameter(cmd, "PageSize", DbType.String, PageSize);
			_db.AddParameter(cmd, "News_Approver", DbType.String, News_Approver);
			_db.AddParameter(cmd, "SortExpression", DbType.String, SortExpression);
			DataTable dataTable = CreateDataTable(cmd);
			return dataTable;
		}

		public DataTable SetupVote_Insert(int vote_id, string SetupVote_TitleColor, string SetupVote_FontSize, string SetupVote_BorderColor, string SetupVote_BackgroundColor, string GenCode, string Width, string Height)
		{
			IDbCommand cmd = _db.CreateCommand("SetupVote_Insert", true);
			_db.AddParameter(cmd, "Vote_ID", DbType.Int32, vote_id);
			_db.AddParameter(cmd, "SetupVote_TitleColor", DbType.String, SetupVote_TitleColor);
			_db.AddParameter(cmd, "SetupVote_FontSize", DbType.String, SetupVote_FontSize);
			_db.AddParameter(cmd, "SetupVote_BackgroundColor", DbType.String, SetupVote_BackgroundColor);
			_db.AddParameter(cmd, "SetupVote_GenCode", DbType.String, GenCode);
			_db.AddParameter(cmd, "SetupVote_Width", DbType.String, Width);
			_db.AddParameter(cmd, "SetupVote_Height", DbType.String, Height);
			DataTable dataTable = CreateDataTable(cmd);
			return dataTable;
		}

		public DataTable SetupVote_Update(int vote_id, string SetupVote_TitleColor, string SetupVote_FontSize, string SetupVote_BorderColor, string SetupVote_BackgroundColor, string GenCode, string Width, string Height)
		{
			IDbCommand cmd = _db.CreateCommand("SetupVote_Update", true);
			_db.AddParameter(cmd, "Vote_ID", DbType.Int32, vote_id);
			_db.AddParameter(cmd, "SetupVote_TitleColor", DbType.String, SetupVote_TitleColor);
			_db.AddParameter(cmd, "SetupVote_FontSize", DbType.String, SetupVote_FontSize);
			_db.AddParameter(cmd, "SetupVote_BackgroundColor", DbType.String, SetupVote_BackgroundColor);
			_db.AddParameter(cmd, "SetupVote_GenCode", DbType.String, GenCode);
			_db.AddParameter(cmd, "SetupVote_Width", DbType.String, Width);
			_db.AddParameter(cmd, "SetupVote_Height", DbType.String, Height);
			DataTable dataTable = CreateDataTable(cmd);
			return dataTable;
		}

		public DataTable SetupVote_GetSetupVoteById(int voteid)
		{
			IDbCommand cmd = _db.CreateCommand("Vote_GetSetupVoteById", true);
			_db.AddParameter(cmd, "Vote_ID", DbType.Int32, voteid);
			DataTable dataTable = CreateDataTable(cmd);
			return dataTable;
		}

		public DataTable vc_UpdatePhotoReportDetailTest(String Photo_Image_1, String PhotoReportDetail_Quotation, Int32 PhotoReportDetails_ID, String Video_Name)
		{
			IDbCommand cmd = _db.CreateCommand("vc_UpdatePhotoReportDetailTest", true);
			_db.AddParameter(cmd, "Photo_Image_1", DbType.String, Photo_Image_1);
			_db.AddParameter(cmd, "PhotoReportDetail_Quotation", DbType.String, PhotoReportDetail_Quotation);
			_db.AddParameter(cmd, "PhotoReportDetails_ID", DbType.Int32, PhotoReportDetails_ID);
			_db.AddParameter(cmd, "Video_Name", DbType.String, Video_Name);

			DataTable dataTable = CreateDataTable(cmd);
			return dataTable;
		}

		public DataTable vc_InsertPhotoReportDetail(String PhotoReportDetail_Image, Int32 PhotoReport_ID, String PhotoReportDetail_Quotation, String Photo_Image_1)
		{
			IDbCommand cmd = _db.CreateCommand("vc_InsertPhotoReportDetail", true);
			_db.AddParameter(cmd, "PhotoReport_ID", DbType.Int32, PhotoReport_ID);
			_db.AddParameter(cmd, "PhotoReportDetail_Image", DbType.String, PhotoReportDetail_Image);
			_db.AddParameter(cmd, "PhotoReportDetail_Quotation", DbType.String, PhotoReportDetail_Quotation);
			_db.AddParameter(cmd, "Photo_Image_1", DbType.String, Photo_Image_1);
			DataTable dataTable = CreateDataTable(cmd);
			return dataTable;
		}
		public DataTable vc_InsertPhotoReportDetail1(String PhotoReportDetail_Image, Int32 PhotoReport_ID, String PhotoReportDetail_Quotation, String Photo_Image_1, String Video_Name)
		{
			IDbCommand cmd = _db.CreateCommand("vc_InsertPhotoReportDetail1", true);
			_db.AddParameter(cmd, "PhotoReport_ID", DbType.Int32, PhotoReport_ID);
			_db.AddParameter(cmd, "PhotoReportDetail_Image", DbType.String, PhotoReportDetail_Image);
			_db.AddParameter(cmd, "PhotoReportDetail_Quotation", DbType.String, PhotoReportDetail_Quotation);
			_db.AddParameter(cmd, "Photo_Image_1", DbType.String, Photo_Image_1);
			_db.AddParameter(cmd, "Video_Name", DbType.String, Video_Name);
			DataTable dataTable = CreateDataTable(cmd);
			return dataTable;
		}

		public DataTable vc_UpdatePhotoReport(Int32 PhotoReport_ID, Int32 PhotoReport_Type, String PhotoReport_Image, String PhotoReport_Title, String User_ID, Boolean PhotoReport_Approval, String PhotoReport_Quotation, String Approver, DateTime PhotoReport_ApprovalDate, Int32 PhotoReportCat_ID)
		{
			IDbCommand cmd = _db.CreateCommand("vc_UpdatePhotoReport", true);
			_db.AddParameter(cmd, "PhotoReport_ID", DbType.Int32, PhotoReport_ID);
			_db.AddParameter(cmd, "PhotoReport_Type", DbType.Int32, PhotoReport_Type);
			_db.AddParameter(cmd, "PhotoReport_Image", DbType.String, PhotoReport_Image);
			_db.AddParameter(cmd, "PhotoReport_Title", DbType.String, PhotoReport_Title);
			_db.AddParameter(cmd, "User_ID", DbType.String, User_ID);
			_db.AddParameter(cmd, "PhotoReport_Approval", DbType.Boolean, PhotoReport_Approval);
			_db.AddParameter(cmd, "PhotoReport_Quotation", DbType.String, PhotoReport_Quotation);
			_db.AddParameter(cmd, "Approver", DbType.String, Approver);
			_db.AddParameter(cmd, "PhotoReport_ApprovalDate", DbType.DateTime, PhotoReport_ApprovalDate);
			_db.AddParameter(cmd, "PhotoReportCat_ID", DbType.Int32, PhotoReportCat_ID);
			DataTable dataTable = CreateDataTable(cmd);
			return dataTable;
		}
		public DataTable vc_UpdatePhotoReportCat(String PhotoReportCat_Des, Int32 PhotoReportCat_ID, Int32 PhotoCat_Assign, String PhotoReportCat_Name)
		{
			IDbCommand cmd = _db.CreateCommand("vc_UpdatePhotoReportCat", true);
			_db.AddParameter(cmd, "PhotoReportCat_Des", DbType.String, PhotoReportCat_Des);
			_db.AddParameter(cmd, "PhotoReportCat_ID", DbType.Int32, PhotoReportCat_ID);
			_db.AddParameter(cmd, "PhotoCat_Assign", DbType.Int32, PhotoCat_Assign);
			_db.AddParameter(cmd, "PhotoReportCat_Name", DbType.String, PhotoReportCat_Name);
			DataTable dataTable = CreateDataTable(cmd);
			return dataTable;
		}
		public DataTable vc_UpdatePhotoReportDetail(String PhotoReportDetail_Image, String PhotoReportDetail_Quotation, Int32 PhotoReport_ID, Int32 PhotoReportDetails_ID)
		{
			IDbCommand cmd = _db.CreateCommand("vc_UpdatePhotoReportDetail", true);
			_db.AddParameter(cmd, "PhotoReportDetail_Image", DbType.String, PhotoReportDetail_Image);
			_db.AddParameter(cmd, "PhotoReportDetail_Quotation", DbType.String, PhotoReportDetail_Quotation);
			_db.AddParameter(cmd, "PhotoReport_ID", DbType.Int32, PhotoReport_ID);
			_db.AddParameter(cmd, "PhotoReportDetails_ID", DbType.Int32, PhotoReportDetails_ID);
			DataTable dataTable = CreateDataTable(cmd);
			return dataTable;
		}

		public DataTable vc_SelectPhotoReport(Int32 PhotoReport_ID)
		{
			IDbCommand cmd = _db.CreateCommand("vc_SelectPhotoReport", true);
			_db.AddParameter(cmd, "PhotoReport_ID", DbType.Int32, PhotoReport_ID);
			DataTable dataTable = CreateDataTable(cmd);
			return dataTable;
		}

		public DataTable vc_SelectPhotoReportByType(Int32 PhotoReport_Type)
		{
			IDbCommand cmd = _db.CreateCommand("vc_SelectPhotoReportByType", true);
			_db.AddParameter(cmd, "PhotoReport_Type", DbType.Int32, PhotoReport_Type);
			DataTable dataTable = CreateDataTable(cmd);
			return dataTable;
		}

		public DataTable vc_SelectPhotoReportCat(Int32 PhotoReportCat_ID)
		{
			IDbCommand cmd = _db.CreateCommand("vc_SelectPhotoReportCat", true);
			_db.AddParameter(cmd, "PhotoReportCat_ID", DbType.Int32, PhotoReportCat_ID);
			DataTable dataTable = CreateDataTable(cmd);
			return dataTable;
		}
		public DataTable vc_SelectPhotoReportCatsAll()
		{
			IDbCommand cmd = _db.CreateCommand("vc_SelectPhotoReportCatsAll", true);
			DataTable dataTable = CreateDataTable(cmd);
			return dataTable;
		}
		public DataTable vc_SelectPhotoReportCatsDynamic(String OrderByExpression, String WhereCondition)
		{
			IDbCommand cmd = _db.CreateCommand("vc_SelectPhotoReportCatsDynamic", true);
			_db.AddParameter(cmd, "OrderByExpression", DbType.String, OrderByExpression);
			_db.AddParameter(cmd, "WhereCondition", DbType.String, WhereCondition);
			DataTable dataTable = CreateDataTable(cmd);
			return dataTable;
		}
		public DataTable vc_SelectPhotoReportCatsPaged()
		{
			IDbCommand cmd = _db.CreateCommand("vc_SelectPhotoReportCatsPaged", true);
			DataTable dataTable = CreateDataTable(cmd);
			return dataTable;
		}
		public DataTable vc_SelectPhotoReportDetail(Int32 PhotoReportDetails_ID)
		{
			IDbCommand cmd = _db.CreateCommand("vc_SelectPhotoReportDetail", true);
			_db.AddParameter(cmd, "PhotoReportDetails_ID", DbType.Int32, PhotoReportDetails_ID);
			DataTable dataTable = CreateDataTable(cmd);
			return dataTable;
		}
		public DataTable vc_SelectPhotoReportDetailsAll()
		{
			IDbCommand cmd = _db.CreateCommand("vc_SelectPhotoReportDetailsAll", true);
			DataTable dataTable = CreateDataTable(cmd);
			return dataTable;
		}
		public DataTable vc_SelectPhotoReportDetailsByPhotoReport_ID(Int32 PhotoReport_ID)
		{
			IDbCommand cmd = _db.CreateCommand("vc_SelectPhotoReportDetailsByPhotoReport_ID", true);
			_db.AddParameter(cmd, "PhotoReport_ID", DbType.Int32, PhotoReport_ID);
			DataTable dataTable = CreateDataTable(cmd);
			return dataTable;
		}
		public DataTable vc_SelectPhotoReportDetailsDynamic(String OrderByExpression, String WhereCondition)
		{
			IDbCommand cmd = _db.CreateCommand("vc_SelectPhotoReportDetailsDynamic", true);
			_db.AddParameter(cmd, "OrderByExpression", DbType.String, OrderByExpression);
			_db.AddParameter(cmd, "WhereCondition", DbType.String, WhereCondition);
			DataTable dataTable = CreateDataTable(cmd);
			return dataTable;
		}
		public DataTable vc_SelectPhotoReportDetailsPaged()
		{
			IDbCommand cmd = _db.CreateCommand("vc_SelectPhotoReportDetailsPaged", true);
			DataTable dataTable = CreateDataTable(cmd);
			return dataTable;
		}
		public DataTable vc_SelectPhotoReportsAll()
		{
			IDbCommand cmd = _db.CreateCommand("vc_SelectPhotoReportsAll", true);
			DataTable dataTable = CreateDataTable(cmd);
			return dataTable;
		}
		public DataTable vc_SelectPhotoReportsByPhotoReportCat_ID(Int32 PhotoReportCat_ID)
		{
			IDbCommand cmd = _db.CreateCommand("vc_SelectPhotoReportsByPhotoReportCat_ID", true);
			_db.AddParameter(cmd, "PhotoReportCat_ID", DbType.Int32, PhotoReportCat_ID);
			DataTable dataTable = CreateDataTable(cmd);
			return dataTable;
		}
		public DataTable vc_SelectPhotoReportsDynamic(String OrderByExpression, String WhereCondition)
		{
			IDbCommand cmd = _db.CreateCommand("vc_SelectPhotoReportsDynamic", true);
			_db.AddParameter(cmd, "OrderByExpression", DbType.String, OrderByExpression);
			_db.AddParameter(cmd, "WhereCondition", DbType.String, WhereCondition);
			DataTable dataTable = CreateDataTable(cmd);
			return dataTable;
		}
		public DataTable vc_SelectPhotoReportsPaged()
		{
			IDbCommand cmd = _db.CreateCommand("vc_SelectPhotoReportsPaged", true);
			DataTable dataTable = CreateDataTable(cmd);
			return dataTable;
		}

		public DataTable vc_SelectCountVideoByType(int PhotoReport_Type)
		{
			IDbCommand cmd = _db.CreateCommand("vc_SelectCountVideoByType", true);
			_db.AddParameter(cmd, "PhotoReport_Type", DbType.Int32, PhotoReport_Type);
			DataTable dataTable = CreateDataTable(cmd);
			return dataTable;
		}
		public DataTable vc_SelectCountPhotoAlbumByType()
		{
			IDbCommand cmd = _db.CreateCommand("vc_SelectCountPhotoAlbumByType", true);
			DataTable dataTable = CreateDataTable(cmd);
			return dataTable;
		}

		public DataTable vc_SelectPhotoReportType1(int PhotoReport_ID)
		{
			IDbCommand cmd = _db.CreateCommand("vc_SelectPhotoReportType1", true);
			_db.AddParameter(cmd, "PhotoReport_ID", DbType.Int32, PhotoReport_ID);
			DataTable dt = CreateDataTable(cmd);
			return dt;
		}
		public DataTable vc_SelectPhotoReportByCarID(int CarID)
		{
			IDbCommand cmd = _db.CreateCommand("vc_SelectPhotoReportByCarID", true);
			_db.AddParameter(cmd, "CarID", DbType.Int32, CarID);
			DataTable dt = CreateDataTable(cmd);
			return dt;
		}
		public DataTable vc_SelectPhotoReportByIDType(int PhotoReportType)
		{
			IDbCommand cmd = _db.CreateCommand("vc_SelectPhotoReportByIDType", true);
			_db.AddParameter(cmd, "PhotoReport_Type", DbType.Int32, PhotoReportType);
			DataTable dataTable = CreateDataTable(cmd);
			return dataTable;
		}
		public DataTable vc_SelectPhotoReportByPhotoReportID(Int32 PhotoReport_ID)
		{
			IDbCommand cmd = _db.CreateCommand("vc_SelectPhotoReportByPhotoReportID", true);
			_db.AddParameter(cmd, "PhotoReport_ID", DbType.Int32, PhotoReport_ID);

			DataTable dataTable = CreateDataTable(cmd);
			return dataTable;
		}

		public DataTable vc_SelectPhotoReportDetailsByPhotoReportDetails_IDTest(Int32 PhotoReport_ID)
		{
			IDbCommand cmd = _db.CreateCommand("vc_SelectPhotoReportDetailsByPhotoReport_IDTest", true);
			_db.AddParameter(cmd, "PhotoReport_ID", DbType.Int32, PhotoReport_ID);

			DataTable dataTable = CreateDataTable(cmd);
			return dataTable;
		}
		public DataTable vc_SelectAlbumCarByCatID(int PhotoReportCat_ID)
		{
			IDbCommand cmd = _db.CreateCommand("vc_SelectAlbumCarByCatID", true);
			_db.AddParameter(cmd, "PhotoReportCat_ID", DbType.Int32, PhotoReportCat_ID);
			DataTable dataTable = CreateDataTable(cmd);
			return dataTable;
		}

		public DataTable vc_SelectPhotoReportDetailsNone()
		{
			IDbCommand cmd = _db.CreateCommand("vc_SelectPhotoReportDetailsNone", true);
			DataTable dataTable = CreateDataTable(cmd);
			return dataTable;
		}
		public DataTable vc_SelectPhotoReportDetailsByNone()
		{
			IDbCommand cmd = _db.CreateCommand("vc_SelectPhotoReportDetailsByNone", true);
			DataTable dataTable = CreateDataTable(cmd);
			return dataTable;
		}

		public DataTable vc_SelectQA_CatByID(int CatID)
		{
			IDbCommand cmd = _db.CreateCommand("vc_SelectQACatByID", true);
			_db.AddParameter(cmd, "CatID", DbType.Int32, CatID);
			DataTable dataTable = CreateDataTable(cmd);
			return dataTable;
		}
		public DataTable vc_InsertQACAT(string CatName)
		{
			IDbCommand cmd = _db.CreateCommand("vc_InsertQACAT", true);
			_db.AddParameter(cmd, "CatName", DbType.String, CatName);
			DataTable dataTable = CreateDataTable(cmd);
			return dataTable;
		}

		public DataTable vc_Insert_QA_Comment_Answer(string QAnswer, DateTime ADate, string Sender, int ParentID, int Type, string Email)
		{
			IDbCommand cmd = _db.CreateCommand("vc_Insert_QA_Comment_Answer", true);
			_db.AddParameter(cmd, "QAnswer", DbType.String, QAnswer);
			_db.AddParameter(cmd, "ADate", DbType.String, ADate);
			_db.AddParameter(cmd, "Sender", DbType.String, Sender);
			_db.AddParameter(cmd, "ParentID", DbType.String, ParentID);
			_db.AddParameter(cmd, "Type", DbType.String, Type);
			_db.AddParameter(cmd, "Email", DbType.String, Email);
			DataTable dataTable = CreateDataTable(cmd);
			return dataTable;
		}

		public DataTable vc_DeleteQACAT(int CatID)
		{
			IDbCommand cmd = _db.CreateCommand("vc_DeleteQACAT", true);
			_db.AddParameter(cmd, "CatID", DbType.Int32, CatID);
			DataTable dataTable = CreateDataTable(cmd);
			return dataTable;
		}
		public DataTable vc_UpdateQA_CAT(int CatID, string CatName)
		{
			IDbCommand cmd = _db.CreateCommand("vc_UpdateQA_CAT", true);
			_db.AddParameter(cmd, "CatID", DbType.Int32, CatID);
			_db.AddParameter(cmd, "CatName", DbType.String, CatName);
			DataTable dataTable = CreateDataTable(cmd);
			return dataTable;
		}

		public DataTable vc_DeletePhotoReport(Int32 PhotoReport_ID)
		{
			IDbCommand cmd = _db.CreateCommand("vc_DeletePhotoReport", true);
			_db.AddParameter(cmd, "PhotoReport_ID", DbType.Int32, PhotoReport_ID);
			DataTable dataTable = CreateDataTable(cmd);
			return dataTable;
		}
		public DataTable vc_DeletePhotoReportCat(Int32 PhotoReportCat_ID)
		{
			IDbCommand cmd = _db.CreateCommand("vc_DeletePhotoReportCat", true);
			_db.AddParameter(cmd, "PhotoReportCat_ID", DbType.Int32, PhotoReportCat_ID);
			DataTable dataTable = CreateDataTable(cmd);
			return dataTable;
		}
		public DataTable vc_DeletePhotoReportCatsDynamic(String WhereCondition)
		{
			IDbCommand cmd = _db.CreateCommand("vc_DeletePhotoReportCatsDynamic", true);
			_db.AddParameter(cmd, "WhereCondition", DbType.String, WhereCondition);
			DataTable dataTable = CreateDataTable(cmd);
			return dataTable;
		}
		public DataTable vc_DeletePhotoReportDetail(String PhotoReportDetails_IDs)
		{
			IDbCommand cmd = _db.CreateCommand("vc_DeletePhotoReportDetail", true);
			_db.AddParameter(cmd, "PhotoReportDetails_IDs", DbType.String, PhotoReportDetails_IDs);
			DataTable dataTable = CreateDataTable(cmd);
			return dataTable;
		}
		public DataTable vc_DeletePhotoReportDetailsByPhotoReport_ID(Int32 PhotoReport_ID)
		{
			IDbCommand cmd = _db.CreateCommand("vc_DeletePhotoReportDetailsByPhotoReport_ID", true);
			_db.AddParameter(cmd, "PhotoReport_ID", DbType.Int32, PhotoReport_ID);
			DataTable dataTable = CreateDataTable(cmd);
			return dataTable;
		}
		public DataTable vc_DeletePhotoReportDetailsDynamic(String WhereCondition)
		{
			IDbCommand cmd = _db.CreateCommand("vc_DeletePhotoReportDetailsDynamic", true);
			_db.AddParameter(cmd, "WhereCondition", DbType.String, WhereCondition);
			DataTable dataTable = CreateDataTable(cmd);
			return dataTable;
		}
		public DataTable vc_DeletePhotoReportsByPhotoReportCat_ID(Int32 PhotoReportCat_ID)
		{
			IDbCommand cmd = _db.CreateCommand("vc_DeletePhotoReportsByPhotoReportCat_ID", true);
			_db.AddParameter(cmd, "PhotoReportCat_ID", DbType.Int32, PhotoReportCat_ID);
			DataTable dataTable = CreateDataTable(cmd);
			return dataTable;
		}
		public DataTable vc_DeletePhotoReportsDynamic(String WhereCondition)
		{
			IDbCommand cmd = _db.CreateCommand("vc_DeletePhotoReportsDynamic", true);
			_db.AddParameter(cmd, "WhereCondition", DbType.String, WhereCondition);
			DataTable dataTable = CreateDataTable(cmd);
			return dataTable;
		}

		public DataTable vc_SelectPhotoReportsByCondition(string sCondition)
		{
			IDbCommand cmd = _db.CreateCommand("vc_SelectPhotoReportsByCondition", true);
			_db.AddParameter(cmd, "Condition", DbType.String, sCondition);
			DataTable dataTable = CreateDataTable(cmd);
			return dataTable;
		}
		public DataTable vc_SelectPhotoReportDetailsByPhotoReportDetails_ID(Int32 PhotoReportDetails_ID)
		{
			IDbCommand cmd = _db.CreateCommand("vc_SelectPhotoReportDetailsByPhotoReportDetails_ID", true);
			_db.AddParameter(cmd, "PhotoReportDetails_ID", DbType.Int32, PhotoReportDetails_ID);

			DataTable dataTable = CreateDataTable(cmd);
			return dataTable;
		}

		public DataTable vc_SelectAlbumCarByCatIDTest()
		{
			IDbCommand cmd = _db.CreateCommand("vc_SelectAlbumCarByCatIDTest", true);
			DataTable dataTable = CreateDataTable(cmd);
			return dataTable;
		}
		public DataTable SelectTopBackGroundByType(int PhotoReport_Type)
		{
			IDbCommand cmd = _db.CreateCommand("vc_SelectTop8BackGroundByType", true);
			_db.AddParameter(cmd, "PhotoReport_Type", DbType.Int32, PhotoReport_Type);
			DataTable dataTable = CreateDataTable(cmd);
			return dataTable;
		}

		public DataTable vc_News_SelectListNewsByRangeNewsId(String sWhere)
		{
			IDbCommand cmd = _db.CreateCommand("vc_News_SelectListNewsByRangeNewsId", true);
			_db.AddParameter(cmd, "sWhere", DbType.String, sWhere);
			DataTable dataTable = CreateDataTable(cmd);
			return dataTable;
		}

		public DataTable vc_ThreadDetail_CheckExistingNews_ID_Thread_ID(String News_ID, Int32 Thread_ID)
		{
			IDbCommand cmd = _db.CreateCommand("vc_ThreadDetail_CheckExistingNews_ID_Thread_ID", true);
			_db.AddParameter(cmd, "sNews_ID", DbType.String, News_ID);
			_db.AddParameter(cmd, "iThread_ID", DbType.Int32, Thread_ID);
			DataTable dataTable = CreateDataTable(cmd);
			return dataTable;
		}

		public DataTable vc_NewsThread_CheckExistingTitle(String Title, Int32 Thread_ID)
		{
			IDbCommand cmd = _db.CreateCommand("vc_NewsThread_CheckExistingTitle", true);
			_db.AddParameter(cmd, "sTitle", DbType.String, Title);
			_db.AddParameter(cmd, "iThread_ID", DbType.Int32, Thread_ID);
			DataTable dataTable = CreateDataTable(cmd);
			return dataTable;
		}
		//End Quizzes_Question

		//EditionType
		public void vc_EditionType_Insert(String EditionName, String EditionDescription, String EditionDisplayURL)
		{
			IDbCommand cmd = _db.CreateCommand("vc_EditionType_Insert", true);
			_db.AddParameter(cmd, "sEditionName", DbType.String, EditionName);
			_db.AddParameter(cmd, "sEditionDescription", DbType.String, EditionDescription);
			_db.AddParameter(cmd, "sEditionDisplayURL", DbType.String, EditionDisplayURL);
			CreateDataTable(cmd);
		}

		public void vc_EditionType_Update(String EditionName, String EditionDescription, Int32 EditionType_ID, String EditionDisplayURL)
		{
			IDbCommand cmd = _db.CreateCommand("vc_EditionType_Update", true);
			_db.AddParameter(cmd, "sEditionName", DbType.String, EditionName);
			_db.AddParameter(cmd, "sEditionDescription", DbType.String, EditionDescription);
			_db.AddParameter(cmd, "iEditionType_ID", DbType.Int32, EditionType_ID);
			_db.AddParameter(cmd, "sEditionDisplayURL", DbType.String, EditionDisplayURL);
			CreateDataTable(cmd);
		}

		public void vc_EditionType_Delete(Int32 EditionType_ID)
		{
			IDbCommand cmd = _db.CreateCommand("vc_EditionType_Delete", true);
			_db.AddParameter(cmd, "iEditionType_ID", DbType.Int32, EditionType_ID);
			CreateDataTable(cmd);
		}

		public DataTable vc_EditionType_SelectOne(Int32 EditionType_ID)
		{
			IDbCommand cmd = _db.CreateCommand("vc_EditionType_SelectOne", true);
			_db.AddParameter(cmd, "iEditionType_ID", DbType.Int32, EditionType_ID);
			DataTable table = CreateDataTable(cmd);
			return table;
		}

		public DataTable vc_EditionType_SelectAll()
		{
			IDbCommand cmd = _db.CreateCommand("vc_EditionType_SelectAll", true);
			DataTable table = CreateDataTable(cmd);

			return table;
		}

		public void vc_Category_Update_EditionType(Int32 Cat_ID, Int32 EditionType)
		{
			IDbCommand cmd = _db.CreateCommand("vc_Category_Update_EditionType", true);
			_db.AddParameter(cmd, "iEditionType", DbType.Int32, EditionType);
			_db.AddParameter(cmd, "iCat_ID", DbType.Int32, Cat_ID);
			DataTable table = CreateDataTable(cmd);
		}
		//EditionType

		public DataTable vc_Execute_Sql(String sSql)
		{
			IDbCommand cmd = _db.CreateCommand("vc_Execute_Sql", true);
			_db.AddParameter(cmd, "sSql", DbType.String, sSql);
			DataTable table = CreateDataTable(cmd);
			return table;
		}

		public DataTable News_GetListByWhereForPaging(string whereSql, string StartIndex, string EndIndex)
		{
			IDbCommand cmd = _db.CreateCommand("News_GetListByWhereForPaging", true);
			_db.AddParameter(cmd, "whereSql", DbType.String, whereSql);
			_db.AddParameter(cmd, "StartIndex", DbType.String, StartIndex);
			_db.AddParameter(cmd, "EndIndex", DbType.String, EndIndex);
			DataTable table = CreateDataTable(cmd);
			return table;
		}

		//SonPC Chuyen Store
		public DataTable vc_Vote_SelectList(String sWhere, Int32 iStartIndex, Int32 iPageSize)
		{
			IDbCommand cmd = _db.CreateCommand("vc_Vote_SelectList", true);
			_db.AddParameter(cmd, "sWhere", DbType.String, sWhere);
			_db.AddParameter(cmd, "iStartIndex", DbType.Int32, iStartIndex);
			_db.AddParameter(cmd, "iPageSize", DbType.Int32, iPageSize);
			DataTable table = CreateDataTable(cmd);
			return table;
		}

		public DataTable vc_Vote_SelectList_Count(String sWhere)
		{
			IDbCommand cmd = _db.CreateCommand("vc_Vote_SelectList_Count", true);
			_db.AddParameter(cmd, "sWhere", DbType.String, sWhere);
			DataTable table = CreateDataTable(cmd);
			return table;
		}

		public DataTable vc_Vote_SelectList_Where(String sWhere)
		{
			IDbCommand cmd = _db.CreateCommand("vc_Vote_SelectList_Where", true);
			_db.AddParameter(cmd, "sWhere", DbType.String, sWhere);
			DataTable table = CreateDataTable(cmd);
			return table;
		}

		public DataTable vc_NewsThread_SelectList(String sWhere, Int32 iStartIndex, Int32 iPageSize)
		{
			IDbCommand cmd = _db.CreateCommand("vc_NewsThread_SelectList", true);
			_db.AddParameter(cmd, "sWhere", DbType.String, sWhere);
			_db.AddParameter(cmd, "iStartIndex", DbType.Int32, iStartIndex);
			_db.AddParameter(cmd, "iPageSize", DbType.Int32, iPageSize);
			DataTable table = CreateDataTable(cmd);
			return table;
		}

		public DataTable vc_NewsThread_SelectList_Count(String sWhere)
		{
			IDbCommand cmd = _db.CreateCommand("vc_NewsThread_SelectList_Count", true);
			_db.AddParameter(cmd, "sWhere", DbType.String, sWhere);
			DataTable table = CreateDataTable(cmd);
			return table;
		}

		public DataTable vc_ThreadDetails_SelectList(String sWhere, Int32 iStartIndex, Int32 iPageSize)
		{
			IDbCommand cmd = _db.CreateCommand("vc_ThreadDetails_SelectList", true);
			_db.AddParameter(cmd, "sWhere", DbType.String, sWhere);
			_db.AddParameter(cmd, "iStartIndex", DbType.Int32, iStartIndex);
			_db.AddParameter(cmd, "iPageSize", DbType.Int32, iPageSize);
			DataTable table = CreateDataTable(cmd);
			return table;
		}

		public DataTable vc_ThreadDetails_SelectList_Count(String sWhere)
		{
			IDbCommand cmd = _db.CreateCommand("vc_ThreadDetails_SelectList_Count", true);
			_db.AddParameter(cmd, "sWhere", DbType.String, sWhere);
			DataTable table = CreateDataTable(cmd);
			return table;
		}

		public DataTable vc_MediaObject_SelectList(String sWhere, Int32 iStartIndex, Int32 iPageSize)
		{
			IDbCommand cmd = _db.CreateCommand("vc_MediaObject_SelectList", true);
			_db.AddParameter(cmd, "sWhere", DbType.String, sWhere);
			_db.AddParameter(cmd, "iStartIndex", DbType.Int32, iStartIndex);
			_db.AddParameter(cmd, "iPageSize", DbType.Int32, iPageSize);
			DataTable table = CreateDataTable(cmd);
			return table;
		}

		public DataTable vc_MediaObject_SelectList_Count(String sWhere)
		{
			IDbCommand cmd = _db.CreateCommand("vc_MediaObject_SelectList_Count", true);
			_db.AddParameter(cmd, "sWhere", DbType.String, sWhere);
			DataTable table = CreateDataTable(cmd);
			return table;
		}
		//SonPC Chuyen Store

		//SonPC 19/03/2008

		//SonPC 19/03/2008

		public DataTable GetActionByNewsId(string news_id)
		{
			IDbCommand cmd = _db.CreateCommand("GetActionByNewsId", true);
			_db.AddParameter(cmd, "newsid", DbType.String, news_id);
			DataTable table = CreateDataTable(cmd);
			return table;
		}

		public DataTable GetSenderActionAprroving(string news_id)
		{
			IDbCommand cmd = _db.CreateCommand("GetSenderActionAprroving", true);
			_db.AddParameter(cmd, "newsid", DbType.String, news_id);
			DataTable table = CreateDataTable(cmd);
			return table;
		}

		public DataTable Question_GetListByCatID(int start_row, int end_row, string cat_id, string noidung)
		{
			IDbCommand cmd = _db.CreateCommand("Question_GetListByCatID", true);
			_db.AddParameter(cmd, "StartRow", DbType.String, start_row);
			_db.AddParameter(cmd, "EndRow", DbType.String, end_row);
			_db.AddParameter(cmd, "Cat_ID", DbType.String, cat_id);
			_db.AddParameter(cmd, "NoiDung", DbType.String, noidung);
			DataTable table = CreateDataTable(cmd);
			return table;
		}

		public DataTable Answer_GetListByHoiID(string Hoi_ID)
		{
			IDbCommand cmd = _db.CreateCommand("Answer_GetListByHoiID", true);
			_db.AddParameter(cmd, "Hoi_ID", DbType.String, Hoi_ID);
			DataTable table = CreateDataTable(cmd);
			return table;
		}

		public DataTable Question_CountGetListByCatID(string cat_id, string noidung)
		{
			IDbCommand cmd = _db.CreateCommand("Question_CountGetListByCatID", true);
			_db.AddParameter(cmd, "Cat_ID", DbType.String, cat_id);
			_db.AddParameter(cmd, "NoiDung", DbType.String, noidung);
			DataTable table = CreateDataTable(cmd);
			return table;
		}

		public void Menu_Insert(string mon, string tue, string wed, string thu, string fri, string sat, string sun
			, string link_mon, string link_tue, string link_wed, string link_thu, string link_fri, string link_sat, string link_sun, int type, DateTime date)
		{
			IDbCommand cmd = _db.CreateCommand("Menu_Insert", true);
			_db.AddParameter(cmd, "Mon", DbType.String, mon);
			_db.AddParameter(cmd, "tue", DbType.String, tue);
			_db.AddParameter(cmd, "wed", DbType.String, wed);
			_db.AddParameter(cmd, "thu", DbType.String, thu);
			_db.AddParameter(cmd, "fri", DbType.String, fri);
			_db.AddParameter(cmd, "sat", DbType.String, sat);
			_db.AddParameter(cmd, "sun", DbType.String, sun);
			_db.AddParameter(cmd, "link_mon", DbType.String, link_mon);
			_db.AddParameter(cmd, "link_tue", DbType.String, link_tue);
			_db.AddParameter(cmd, "link_wed", DbType.String, link_wed);
			_db.AddParameter(cmd, "link_thu", DbType.String, link_thu);
			_db.AddParameter(cmd, "link_fri", DbType.String, link_fri);
			_db.AddParameter(cmd, "link_sat", DbType.String, link_sat);
			_db.AddParameter(cmd, "link_sun", DbType.String, link_sun);
			_db.AddParameter(cmd, "type", DbType.Int32, type);
			_db.AddParameter(cmd, "Date", DbType.DateTime, date);
			CreateDataTable(cmd);

		}

		public void Menu_Update(int menu_id, string mon, string tue, string wed, string thu, string fri, string sat, string sun
			, string link_mon, string link_tue, string link_wed, string link_thu, string link_fri, string link_sat, string link_sun, int type, DateTime date)
		{
			IDbCommand cmd = _db.CreateCommand("Menu_Update", true);
			_db.AddParameter(cmd, "menu_id", DbType.Int32, menu_id);
			_db.AddParameter(cmd, "Mon", DbType.String, mon);
			_db.AddParameter(cmd, "tue", DbType.String, tue);
			_db.AddParameter(cmd, "wed", DbType.String, wed);
			_db.AddParameter(cmd, "thu", DbType.String, thu);
			_db.AddParameter(cmd, "fri", DbType.String, fri);
			_db.AddParameter(cmd, "sat", DbType.String, sat);
			_db.AddParameter(cmd, "sun", DbType.String, sun);
			_db.AddParameter(cmd, "link_mon", DbType.String, link_mon);
			_db.AddParameter(cmd, "link_tue", DbType.String, link_tue);
			_db.AddParameter(cmd, "link_wed", DbType.String, link_wed);
			_db.AddParameter(cmd, "link_thu", DbType.String, link_thu);
			_db.AddParameter(cmd, "link_fri", DbType.String, link_fri);
			_db.AddParameter(cmd, "link_sat", DbType.String, link_sat);
			_db.AddParameter(cmd, "link_sun", DbType.String, link_sun);
			_db.AddParameter(cmd, "type", DbType.Int32, type);
			_db.AddParameter(cmd, "Date", DbType.DateTime, date);
			CreateDataTable(cmd);

		}

		public DataTable GetMenuByID(int menu_id)
		{
			IDbCommand cmd = _db.CreateCommand("GetMenuByID", true);
			_db.AddParameter(cmd, "menu_id", DbType.Int32, menu_id);
			DataTable table = CreateDataTable(cmd);
			return table;
		}

		public DataTable ThreadDetail_GetThreadDetailByNewsId(string news_id)
		{
			IDbCommand cmd = _db.CreateCommand("ThreadDetail_GetThreadDetailByNewsId", true);
			_db.AddParameter(cmd, "news_id", DbType.String, news_id);
			DataTable table = CreateDataTable(cmd);
			return table;
		}


		public DataTable FeedBack_GetList(string title, string cat_id, string startIndex, string endIndex)
		{
			IDbCommand cmd = _db.CreateCommand("FeedBack_GetList", true);
			_db.AddParameter(cmd, "title", DbType.String, title);
			_db.AddParameter(cmd, "cat_id", DbType.String, cat_id);
			_db.AddParameter(cmd, "startIndex", DbType.Int32, startIndex);
			_db.AddParameter(cmd, "endIndex", DbType.Int32, endIndex);
			DataTable table = CreateDataTable(cmd);
			return table;
		}

		public DataTable FeedBack_CountList(string title, string cat_id)
		{
			IDbCommand cmd = _db.CreateCommand("FeedBack_CountList", true);
			_db.AddParameter(cmd, "title", DbType.String, title);
			_db.AddParameter(cmd, "cat_id", DbType.String, cat_id);
			DataTable table = CreateDataTable(cmd);
			return table;
		}


		// Top Click And Comment
		public DataTable BonBaiNoiBat_Select()
		{
			IDbCommand cmd = _db.CreateCommand("BonBaiNoiBat_Select", true);
			DataTable table = CreateDataTable(cmd);
			return table;
		}
		public void BonBaiNoiBat_Delete()
		{
			IDbCommand cmd = _db.CreateCommand("BonBaiNoiBat_Delete", true);
			CreateDataTable(cmd);
		}

		public DataTable BonBaiNoiBat_Insert(Int64 News_ID, Boolean isNoiBat, Int32 ThuTu)
		{

			IDbCommand cmd = _db.CreateCommand("BonBaiNoiBat_Insert", true);
			_db.AddParameter(cmd, "News_ID", DbType.Int64, News_ID);
			_db.AddParameter(cmd, "isNoiBat", DbType.Boolean, isNoiBat);
			_db.AddParameter(cmd, "ThuTu", DbType.Int32, ThuTu);
			DataTable table = CreateDataTable(cmd);
			return table;
		}
		public DataTable BonBaiNoiBat_BaiNoiBat_Select()
		{
			IDbCommand cmd = _db.CreateCommand("BonBaiNoiBat_BaiNoiBat_Select", true);
			DataTable table = CreateDataTable(cmd);
			return table;
		}
		public DataTable BonBaiNoiBat_Select_DS_Qua()
		{
			IDbCommand cmd = _db.CreateCommand("BonBaiNoiBat_Select_DS_Qua", true);
			DataTable table = CreateDataTable(cmd);
			return table;
		}
		public DataTable vc_TopNewSelect()
		{
			IDbCommand cmd = _db.CreateCommand("vc_TopNewSelect", true);
			DataTable dataTable = CreateDataTable(cmd);
			return dataTable;
		}

		public DataTable GetCommentThaoLuanNotReadCount(int FeedBack_ID)
		{
			IDbCommand cmd = _db.CreateCommand("GetCommentThaoLuanNotReadCount", true);
			_db.AddParameter(cmd, "FeedBack_ID", DbType.Int32, FeedBack_ID);
			DataTable table = CreateDataTable(cmd);
			return table;
		}
		public DataTable GetCommentThaoLuanCount(int FeedBack_ID)
		{
			IDbCommand cmd = _db.CreateCommand("GetCommentThaoLuanCount", true);
			_db.AddParameter(cmd, "FeedBack_ID", DbType.Int32, FeedBack_ID);
			DataTable table = CreateDataTable(cmd);
			return table;
		}

		public DataTable vcc_AdminSearchCommentThaoLuanByKeyword(string Where, string StartIndex, string PageSize)
		{
			IDbCommand cmd = _db.CreateCommand("vcc_AdminSearchCommentThaoLuanByKeyword", true);
			_db.AddParameter(cmd, "where", DbType.String, Where);
			_db.AddParameter(cmd, "StartIndex", DbType.String, StartIndex);
			_db.AddParameter(cmd, "PageSize", DbType.String, PageSize);

			DataTable dataTable = CreateDataTable(cmd);
			return dataTable;
		}

		public DataTable vcc_CountAdminSearchCommentThaoLuanByKeyword(string Where)
		{
			IDbCommand cmd = _db.CreateCommand("vcc_CountAdminSearchCommentThaoLuanByKeyword", true);
			_db.AddParameter(cmd, "where", DbType.String, Where);
			DataTable dataTable = CreateDataTable(cmd);
			return dataTable;
		}

		public void Comment_FeedBackNewsUpdate(Int64 Comment_ID, Int64 FeedBack_ID, Decimal Comment_Rate, DateTime Comment_Date, String Comment_Content, String Comment_User, Boolean Comment_Approved, String Comment_Email, String Approver)
		{
			IDbCommand cmd = _db.CreateCommand("Comment_FeedBackNewsUpdate", true);
			_db.AddParameter(cmd, "Comment_ID", DbType.Int64, Comment_ID);
			_db.AddParameter(cmd, "FeedBack_ID", DbType.Int64, FeedBack_ID);
			_db.AddParameter(cmd, "Comment_Rate", DbType.Decimal, Comment_Rate);
			_db.AddParameter(cmd, "Comment_Date", DbType.DateTime, Comment_Date);
			_db.AddParameter(cmd, "Comment_Content", DbType.String, Comment_Content);
			_db.AddParameter(cmd, "Comment_User", DbType.String, Comment_User);
			_db.AddParameter(cmd, "Comment_Approved", DbType.Boolean, Comment_Approved);
			_db.AddParameter(cmd, "Comment_Email", DbType.String, Comment_Email);
			_db.AddParameter(cmd, "Approver", DbType.String, Approver);
			CreateDataTable(cmd);

		}
		public DataTable CountAllCommentThaoLuan()
		{
			IDbCommand cmd = _db.CreateCommand("CountAllCommentThaoLuan", true);
			DataTable dataTable = CreateDataTable(cmd);
			return dataTable;
		}

		public DataTable CountAllComment()
		{
			IDbCommand cmd = _db.CreateCommand("CountAllComment", true);
			DataTable dataTable = CreateDataTable(cmd);
			return dataTable;
		}

		public DataTable CountComment()
		{
			IDbCommand cmd = _db.CreateCommand("CountComment", true);
			DataTable dataTable = CreateDataTable(cmd);
			return dataTable;
		}

		public DataTable CountFeedBackNews()
		{
			IDbCommand cmd = _db.CreateCommand("CountFeedBackNews", true);
			DataTable dataTable = CreateDataTable(cmd);
			return dataTable;
		}


		public DataTable CountCommentFeedbacknews()
		{
			IDbCommand cmd = _db.CreateCommand("CountCommentFeedbacknews", true);
			DataTable dataTable = CreateDataTable(cmd);
			return dataTable;
		}


		public DataTable TopFeedBackSelect()
		{
			IDbCommand cmd = _db.CreateCommand("TopFeedBackSelect", true);
			DataTable dataTable = CreateDataTable(cmd);
			return dataTable;
		}

		public DataTable FeedBackNews_Select()
		{
			IDbCommand cmd = _db.CreateCommand("FeedBackNews_Select", true);
			DataTable table = CreateDataTable(cmd);
			return table;
		}

		public DataTable CommentThaoLuan_GetList(string strWhere, string Comment_Approved, string StartIndex, string EndIndex)
		{
			IDbCommand cmd = _db.CreateCommand("CommentThaoLuan_GetList", true);
			_db.AddParameter(cmd, "strWhere", DbType.String, strWhere);
			_db.AddParameter(cmd, "Comment_Approved", DbType.String, Comment_Approved);
			_db.AddParameter(cmd, "StartIndex", DbType.String, StartIndex);
			_db.AddParameter(cmd, "EndIndex", DbType.String, EndIndex);
			DataTable dataTable = CreateDataTable(cmd);
			return dataTable;
		}

		public DataTable CommentThaoLuan_Count(string strWhere, string Comment_Approved)
		{
			IDbCommand cmd = _db.CreateCommand("CommentThaoLuan_Count", true);
			_db.AddParameter(cmd, "strWhere", DbType.String, strWhere);
			_db.AddParameter(cmd, "Comment_Approved", DbType.String, Comment_Approved);
			DataTable dataTable = CreateDataTable(cmd);
			return dataTable;
		}


		// bacth [4:16 PM 6/3/2008]
		public bool News_UpdateViewCount(long newsId, long viewCount)
		{
			IDbCommand cmd = _db.CreateCommand("News_UpdateViewCount", true);
			_db.AddParameter(cmd, "NewsId", DbType.Int64, newsId);
			_db.AddParameter(cmd, "ViewCount", DbType.Int64, viewCount);
			return cmd.ExecuteNonQuery() == 1;
		}

		// bacth [4:16 PM 6/3/2008]
		public bool Category_Delete(int catId)
		{
			IDbCommand cmd = _db.CreateCommand("Category_Delete", true);
			_db.AddParameter(cmd, "Cat_ID", DbType.Int32, catId);
			return cmd.ExecuteNonQuery() == 1;
		}


        public DataTable News_GetAllNewsTemplist(string strWhere, string StartIndex, string EndIndex)
        {
            IDbCommand cmd = _db.CreateCommand("News_GetAllNewsTemplist", true);
            _db.AddParameter(cmd, "strWhere", DbType.String, strWhere);
            _db.AddParameter(cmd, "StartIndex", DbType.String, StartIndex);
            _db.AddParameter(cmd, "EndIndex", DbType.String, EndIndex);
            DataTable dataTable = CreateDataTable(cmd);
            return dataTable;
        }

        public DataTable News_GetAllNewsTemplistCount(string strWhere)
        {
            IDbCommand cmd = _db.CreateCommand("News_GetAllNewsTemplistCount", true);
            _db.AddParameter(cmd, "strWhere", DbType.String, strWhere);
            DataTable dataTable = CreateDataTable(cmd);
            return dataTable;
        }

        public DataTable CountCommentByNewsId(string News_ID)
        {
            IDbCommand cmd = _db.CreateCommand("CountCommentByNewsId", true);
            _db.AddParameter(cmd, "News_ID", DbType.String, News_ID);
            DataTable dataTable = CreateDataTable(cmd);
            return dataTable;
        }

        #region News_UnSign
        public void Insert_News_UnSign(long News_UnSign, string News_Title_Unsign, string News_InitContent_Unsign, string News_Content_Unsign)
        {
            IDbCommand cmd = _db.CreateCommand("Xmobile_Insert_News_UnSign", true);
            _db.AddParameter(cmd, "News_UnSign", DbType.Int64, News_UnSign);
            _db.AddParameter(cmd, "News_Title_Unsign", DbType.String, News_Title_Unsign);
            _db.AddParameter(cmd, "News_InitContent_Unsign", DbType.String, News_InitContent_Unsign);
            _db.AddParameter(cmd, "News_Content_Unsign", DbType.String, News_Content_Unsign);
            DataTable dataTable = CreateDataTable(cmd);
        }

        public void Update_News_UnSign(long News_UnSign, string News_Title_Unsign, string News_InitContent_Unsign, string News_Content_Unsign)
        {
            IDbCommand cmd = _db.CreateCommand("Xmobile_Update_News_UnSign", true);
            _db.AddParameter(cmd, "News_UnSign", DbType.Int64, News_UnSign);
            _db.AddParameter(cmd, "News_Title_Unsign", DbType.String, News_Title_Unsign);
            _db.AddParameter(cmd, "News_InitContent_Unsign", DbType.String, News_InitContent_Unsign);
            _db.AddParameter(cmd, "News_Content_Unsign", DbType.String, News_Content_Unsign);
            DataTable dataTable = CreateDataTable(cmd);
        }

        public void Delete_News_UnSign(long News_UnSign)
        {
            IDbCommand cmd = _db.CreateCommand("Xmobile_Delete_News_UnSign", true);
            _db.AddParameter(cmd, "News_UnSign", DbType.Int64, News_UnSign);
   
            DataTable dataTable = CreateDataTable(cmd);
        }

        #endregion
    }
}